Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm experimenting some troubles with a wordpress installation backed on nginx. The architecture is held in amazon and is the following:

EC2 Nginx 1.2.4 + php-fpm Server EC2 NFS Server RDS mysql

The nginx reads the site files from a nfs partition at /mnt/sharedpool/blog

The fstab config is:

compute-1.amazonaws.com:/mnt/sharedpool /mnt/sharedpool nfs rw,relatime 0 0

The nfs server /etc/exports config:

/mnt/sharedpool ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com(rw,sync)

The nginx user and group are set to www-data:www-data and the root directive of the site is set to /mnt/sharedpool/blog

I downloaded the last version of wordpress and sucessfully installed it. The thing is that after logged in, I'm getting 403 Forbidden.. I think is should be a wordpress setting, given the fact that I can create and call a phpinfo() in the same directory.

UPDATED:

Nginx Server Config:

user www-data www-data; worker_processes 1; pid /var/run/nginx.pid;

events { worker_connections 768; # multi_accept on; }

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

}

Nginx site config:

server { listen 80; #listen [::]:80 default_server ipv6only=on; ## listen for ipv6

    root /mnt/sharedpool/blog;
    index index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;

    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ /index.php;
            # Uncomment to enable naxsi on this location
            # include /etc/nginx/naxsi.rules
    }

    location /doc/ {
            alias /usr/share/doc/;
            #autoindex on;
    #       allow 127.0.0.1;
    #       allow ::1;
    #       deny all;
    }


    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    #error_page 500 502 503 504 /50x.html;
    #location = /50x.html {
    #       root /usr/share/nginx/www;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one

    location ~ /\.ht {
            deny all;
    }

}

Thanks in advance!

share|improve this question
    
So what's in the log files? –  Michael Hampton Nov 18 '12 at 0:35
    
Oh sorry, here: 2012/11/18 00:41:16 [error] 847#0: *3 directory index of "/mnt/sharedpool/blog/" is forbidden, client: 190.17.2.xxx, server: localhost, request: "GET / HTTP/1.1", host: "23.23.141.xxx" –  n3k Nov 18 '12 at 0:43
    
Hm, OK, well then we need to see your nginx configuration. Feel free to edit your question and provide the necessary details. –  Michael Hampton Nov 18 '12 at 0:51
add comment

1 Answer 1

up vote 0 down vote accepted

It looks like nginx isn't quite sure what index file to load for your site. Since it's a PHP-based site (WordPress), this should be index.php. But your index directive reads:

    index index.html index.htm;

I would change this to:

    index index.php;
share|improve this answer
    
Thank you very much! That made ​​it work perfectly. –  n3k Nov 18 '12 at 1:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.