403 forbidden

February 20, 2013 4k views
Hi, I have nginx and a wordpress website running on my vps. During development I used deny all and only allow my ip in the nginx vhost. Which worked fine, I could dev the website and the rest of the world would get a 403 forbidden. Now I tried to make my website public (by removing the deny all line). But visitors still get to see the 403 error. Yet I can still see the website just fine. As far as I can see the file permissions are all set as it should, recursively from /var/www/ with 755 on folders and 644 on files. The owner and group is set as www-data. Ofcourse I reloaded nginx. Am I missing something? Any help is much appreciated! Cheers, Richard
4 Answers
1. Is nginx htdocs root set to /var/www, normally its /usr/share/nginx/...
2. Is nginx running as www-data?
1. The dir structure for my websites is /var/www/mydomain.tld/public. Owned by user and group: www-data. Could that cause issues?
2. In my nginx.conf file the user is www-data. Is that what you mean?
If you are seeing the website but other visitors are getting a 403 then it isn't a permissions problem otherwise everyone would be seeing that.

You may want to doublecheck that your domain does resolve to the IP of your virtual server just to ensure that you are indeed visiting the running site on the droplet.

If that is the case and since you did mention that you already had a config that restricted access why not remove it entirely because from the original message it wasn't clear if you attempted to modify it to let people through or just removed it entirely.
Thanks for your reply. I resolved the issue. Turns out in another vhost on the same server I accidentally placed the allow/deny access restrictions outside of the server block instead of inside. So it restricted globally on both vhosts.
Have another answer? Share your knowledge.