1. Home
  2. Docs
  3. Nginx Secure Plugin
  4. Getting Started

Getting Started

Configuration

The plugin does not have any configuration option. The plugin detects the information it needs to generate Nginx directives required to protect your website from common threats. You have to add these directives to your Nginx configuration.

Nginx Secure Plugin generates Nginx server directives as per your website requirement. You have to add these directives to Nginx configuration file. The Nginx configuration file will be located in /etc/nginx/nginx.conf or /usr/local/nginx/conf/nginx.conf or /usr/local/etc/nginx/nginx.conf .

Follow below steps to add plugin generated configuration to your Nginx server

How to add directives to Nginx Configuration?

Step 1

Create a blank file secure.conf in directory nginx configuration file is located. For example if nginx.conf is located in /etc/nginx then create secure.conf in this directory.

Step 2

Copy directives generated by plugin into this file. You can select all , copy all and paste all. Save the file secure.conf.

Step 3

Open the website configuration file located in sites-available directory of Nginx configuration directory. For example of Nginx.conf lies in /etc/nginx then sites-available directory will be in /etc/nginx.

Step 4

In this file look for below lines

server {

}

Step 5

Include the file in the server block preferably towards the end or after line

index index.php;

Step 6

So your final configuration will look like

server {

 

include secure.conf;

}

Step 7

Restart or reload Nginx configuration

service nginx reload

or

service nginx restart