Easily configure a performant, secure, and stable NGINX server.Learn More
How to insert a code before before location / block?
Hi everyone, I am very new to nginx environment. I have installed WP CMS on my nginx server. Secondly, i am trying to hide the platform from cms detection so the wordpress hiding plugin wants me to manually rewrite the nginx.conf files and insert a rewrite code before the location / block of the configuration file.
Now usually the nginx.cinf files is location at /etc/nginx/sites-available/
however, in my case it under at /www/server/nginx/conf .
But the problem is there are two files of the configuration 1. nginx.conf and 2. nginx.conf.default
when I open the conf.default file it has a location / block where I can easily insert the code but since this is not the active configuration file I am forced to look into the existing nginx.conf file and insert code before any Location / block.
but this doesn’t help the plugin to verify the rewrite rules.
I am fairly a noob at this and require anyone with prior experience help solve this issue to verify the rewrite rules and further.
Here is the link to my nginx.conf file if it helps
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×