Search code examples
nginxhttp-status-code-403permission-deniednginx-locationnginx-config

Nginx 403 permission denied, chown/chmod don't seem to work


I can't get my nginx working, I am getting permission denied.

Tried:

sudo chmod o+x /home
sudo chmod o+x /home/path-to-www
sudo chown -R nginx:nginx /home/path-to-www/www
sudo chmod -R 755 /home/path-to-www/www/
service nginx restart

The above did not work.

So I tried:

sudo chown -R path-to-www:path-to-www /home/path-to-www/www

plus:

setting the nginx user to path-to-www and retarting again.

This didn't work as well.

I am out of ideas. Anyone?


Solution

  • Solved: It was Selinux. I disabled it and rebooted and it worked.