I am setting up my blog on a new instance of EC2 because one of the sites on the server that currently hosts it is DDoSed. I have problems with nginx, because I can either see all the pages in order, but 403 in the index, or see the index, but 404 in the pages (depending on the configuration used)
Here is my nginx configuration:
server { listen 80; server_name www.test.com; server_name test.com; root /www/blog; include conf.d/wordpress/simple.conf; }
And simple.conf:
location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location / {
if I change try_files $ uri $ uri // index.php? $ args; for index.php , the first page will work fine and the rest will be 404. If I leave it like this, the first page will be 403.
Here's the error log:
2013/08/07 19:19:41 [error] 25333#0: *1 directory index of "/www/blog/" is forbidden, client: 64.129.XX, server: test.com, request: "GET / HTTP/1.1", host: "www.test.com"
This directory has a value of 755 for user nginx:
drwxr-xr-x 6 nginx nginx 4096 Aug 7 18:42 blog
Is there something obvious I'm doing wrong?
Thanks!
source share