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

ctrlz
  • 101
  • 1
  • 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! – gxx Feb 10 '16 at 10:17

2 Answers2

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
-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!!

ctrlz
  • 101
  • 1
  • 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. – gxx Feb 10 '16 at 10:18