0

I had Wordpress working inside a Rails application using fastcgi. Now I'm moving everything around so that it can be accessed at /blog in production. I moved the wordpress files and updated the nginx location block from /wptest to /blog. However, I'm suddenly getting a 403 error. I believe my file permissions are correct -- drwxrwxr-x for all folders and -rw-rw-r-- for files.

Appreciate any suggestions.

Here is my nginx configuration:

server {
    listen       80;
    server_name [private];

    root [private];
    index index.html index.htm index.php;
    try_files $uri/index.html $uri/index.php $uri;

    if (-f $request_filename) {
            break;
    }

    location / {
        rails_env production;
        passenger_enabled on;
        rails_spawn_method smart;
    }

    location /blog {
        index index.php;
        try_files $uri $uri/ $uri/index.php;

        location ~ \.php$ {
            include /usr/local/bin/nginx/conf/fastcgi_params;                                       
            fastcgi_index index.php;
            fastcgi_read_timeout 120;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_pass unix:/tmp/php.socket;
        }
    }
}
2
  • 1
    What is the content of nginx error.log? Aug 7, 2014 at 22:54
  • I was seeing: directory index forbidden
    – AJohnson
    Aug 8, 2014 at 15:14

1 Answer 1

1

The issue has been resolved. Turns out nginx was not properly restarting, so the changes to the nginx config file were not being pulled in.

Running "sudo stop nginx", killing all the lingering nginx processes, and then restarting nginx fixed the issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .