1

I have an Ubuntu server running Nginx, php-fpm, and wordpress in a subdirectory. My config looks like this:

server {
    #My site configuration
    location /blog {
            root /home/user/www;
            index index.php index.html index.htm;
            error_log       /var/log/blog_error.log;
            error_page 404 /blog/404.html;
            error_page 500 502 503 504 /blog/50x.html;
            location /blog/ {
                    try_files $uri $uri/ /blog/index.php?$args;
            }
            location = /blog/favicon.ico { log_not_found off; access_log off; }
            location = /blog/robots.txt { allow all; log_not_found off; access_log off; }
            location ~ /blog/\. { deny all; }
            location ~* /blog/(?:uploads|files)/.*\.php$ { deny all; }
            rewrite /blog/wp-admin$ $scheme://$host$uri/ permanent;
            if (!-e $request_filename) {
                    rewrite ^(.*)$ /blog/index.php?q=$1 last;
                    break;
            }
            location ~ \.php$ {
                    #try_files $uri =404;
                    fastcgi_split_path_info ^(/blog)(/.*)$;
                    fastcgi_index blog/index.php;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    include fastcgi_params;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
            }
            location ~* ^.+\.(css|js|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
                    access_log off; log_not_found off; expires max;
            }
    }
}

With a fresh WP installation version 3.7.1, I get Invalid post type when I click on the Posts link in my dashboard.

https://i.sstatic.net/oExqD.png

And when I click on Add New Post I get the new post page but the right sidebar which should contain the Post button and other controls shows empty.

https://i.sstatic.net/kPEfs.png

I'm sure it has got to do something with my configuration, because I'm trying with a fresh DB and a fresh WP.

Any ideas?

Thanks.

6
  • What plugins did you install? Commented Dec 10, 2013 at 8:01
  • No plugins at all, fresh installation.
    – mpcabd
    Commented Dec 10, 2013 at 10:37
  • I know of no reason why your nginx configuration should cause these problems, and I don't see any serious problems in it. The cause of these problems almost certainly lies elsewhere. Commented Dec 10, 2013 at 16:12
  • I tried a subdomain configuration instead of a subdirectory and it worked flawlessly, the same WP and DB, no changes, only to nginx! This is driving me crazy.
    – mpcabd
    Commented Dec 15, 2013 at 5:56
  • Wait a minute, are you trying to run multisite in a subdirectory? I don't think you can do that. Commented Dec 15, 2013 at 6:00

1 Answer 1

1

The issue was solved by commenting out this line

fastcgi_split_path_info ^(/blog)(/.*)$;

It solved the issue, with apparently no side effects. I got the answer on Wordpress.org forums which was originally posted on nginx forums

Cheers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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