Include the wphide-nginx.conf containing custom rewrites to your server configuration.
In Nginx, you can include additional configuration/rewrite files within the main nginx.conf file or within server block configurations using the include directive. However, there are some considerations to keep in mind.
When customizing the plugin options, it generates the necessary Nginx rewrite data, available in the Setup interface. If the “Save the Nginx Rewrites to a wphide-nginx.conf” option within the site root is enabled, the plugin attempts to deploy these rewrites to a file named wphide-nginx.conf located in the site root directory.
Using the above option, Instead of copying the entire rewrite data block, you can include the file wphide-nginx.conf in the Nginx server configuration.
With this approach, you still have to restart the Nginx service after modifying the options. This ensures that the system recognizes and applies the new rewrites
- Open the site nginx.conf file in a text editor. This file is typically located in the /etc/nginx/sites-available/ directory.
- Inside the http block, you can use the include directive provided by the plugin, within the Setup interface. For example:
http { # Other configuration settings... server { # Your existing server block configuration... include /path/to/your/site/root/wphide-nginx.conf; } }
Make sure to replace /path/to/your/site/root/wphide-nginx.conf with the actual path the plugin provided through the Setup interface.
- Reload or restart Nginx to apply the changes:
sudo service nginx reload
Keep in mind that can be different, depending on the system type. Check with your host for more details.
- Click the Confirm button, within the Setup interface, so the plugin checks the rewrites and activates the updated options.
- Clear the site caches.
Recent Comments