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;
        }
    }
}
AJohnson
  • 11
  • 3

1 Answers1

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.

AJohnson
  • 11
  • 3