I moved my website from apache to nginx and everything seems to be
working as expected except (Well, I’ve only seen that error) when I try
to create posts through the Atom publishing protocol which can be
accesed via http://wordpressblog.com/wp-app.php, on apache it worked
well but on nginx it gives me a 404 error, I think it’s not only me
because every other wordpress blog that is using nginx gives me that
error.
I could only find this that could be semi-related to this error: http://core.trac.wordpress.org/ticket/7361 but it is a fix for apache
and I can’t make it work on nginx
Any ideas to fix it?
If you have a wordpress blog running on nginx I’d appreciate if you tell
me if you can correctly access your wp-app.php file.
Note that I’m currently using php-cgi with nginx, Could php-fpm make it
work?
This doesn’t make sense:
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php last;
}
You’re capturing the URI for what?
The Atom publishing works for me. I use a nested location and avoid
fastcgi_split_path_info. Following the suggestions of Igor and Maxim
on the list some time ago. Here’s the PHP handling part.
## Regular PHP processing.
location ~ ^(?<script>.+\.php)(?<path_info>.*)$ {
include fastcgi.conf;
## The fastcgi_params must be redefined from the ones
## given in fastcgi.conf. No longer standard names
## but arbitrary: named patterns in regex.
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
## Passing the request upstream to the FastCGI
## listener.
fastcgi_pass unix:/tmp/php-cgi/php-cgi.socket;
## Upload progress support.
track_uploads uploads 60s;
}
Note that this is just a snippet from the full config. There is also a
try_files directive:
## The 'final' attempt to serve the request.
location @nocache {
try_files $uri $uri/ /index.php?q=$uri&$args;
}