在arch-linux中使用nginx、php-fpm和wordpress进行实验设置-获取403


Experimental set-up with nginx, php-fpm and wordpress in arch linux - getting 403

这是我的nginx配置:-

user http;
worker_processes  1;
events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    # main access log
    access_log  /var/log/nginx_access.log  main;
    # main error log
    error_log  /var/log/nginx_error.log debug;
    # My django main site
    server {
        listen   80;
        server_name mysite.com;
        # no security problem here, since / is alway passed to upstream
        root /var/git/mysite_live;
        # serve directly - analogous for static/staticfiles
        location /static {
            alias /var/git/mysite_live/public/static;
        }
        location /media {
            alias /var/git/mysite_live/public/media;
        }
        location / {
            proxy_pass_header Server;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_connect_timeout 10;
            proxy_read_timeout 10;
            proxy_pass http://localhost:8000/;
        }
        # what to serve if upstream is not available or crashes
        error_page 500 502 503 504 /media/50x.html;
    }
    # My wordpress blog, on a subdomain
    server {
        listen       80;                    # our server's public IP address:port
        server_name  blog.mysite.com;        # our domain name
        root         /srv/http/wordpress/;  # absolute path to your WordPress installation
        try_files $uri $uri/ /index.php;
        location ~ '.php$ {
            include        fastcgi_params;
            fastcgi_pass   localhost:9000;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        }
    }
}

我已经安装了php-fpm,并且在我的arch-linux服务器上运行rc.d start php-fpm运行得很好。

我是不是错过了一些阻止nginx使用php-fpm服务器的东西——在这个反向代理设置中,它应该为我位于/srv/http/wordpress的wordpress网站提供服务?

当我访问blog.mysite.com时,我收到了一个403 Forbidden错误,在我的nginx错误日志中,显示了相同的错误:

2012/03/03 05:09:30 [error] 26414#0: *7 directory index of "/srv/http/wordpress/" is forbidden, client: 133.235.39.138, server: blog.mysite.com, request: "GET / HTTP/1.1", host: "blog.mysite.com"  

更改:

    try_files $uri $uri/ /index.php;

收件人:

    try_files $uri /index.php;