I have Cent OS 6.6 with nginx 1.8.1 installed. It seems like if I change the root in the conf file to something other than the default '/usr/share/nginx' it gives an error 403 Permission denied. I have even given 777 permission to the other folder and files and it still doesn't work. I tried changing the user in nginx to 'apache', 'nginx' or'root' and that doesn't work either. I have disabled SELinux too. The folder I was trying to get it to work is '/var/www/'. Is there some enforcement in this version of nginx so it only works with '/usr/share/nginx' root?
Use an appropriate directory to store your web documents, so that you do not need to disable SELinux.
These directories are:
And if you have problems, don't grope around blindly; check the logs to find out the specific problem.
Even though I disabled SELinux by modifying the config file it was still enabled. I had to run the command 'setenforce Permissive' and it worked!!