-1

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?

  • 1.) "[...]Is there some enforcement in this version of nginx so it only works with '/usr/share/nginx' root?[...]" I strongly doubt this. 2.) Doing chmod 777 is a big no-go. Don't do this! – gf_ Feb 10 '16 at 10:17
0

Use an appropriate directory to store your web documents, so that you do not need to disable SELinux.

These directories are:

  • /var/www
  • /srv/www

And if you have problems, don't grope around blindly; check the logs to find out the specific problem.

-1

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!!

  • 1
    Maybe it would be wise to think about if disabling SELinux is the way to go, or it would be more appropriate to edit the config accordingly. – gf_ Feb 10 '16 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.