Confusion with fastcgi handoff, etc.

mike mike503 at
Tue May 27 01:53:20 MSD 2008

I'm trying to figure out why theres a desync between fastcgi and nginx here.

The URL has .php in it, so it should be sent to fastcgi. But I get a 404 thrown.

Does anyone see anything wrong here?

I get the infamous "No input file specified."

The only difference here is that i have ".php" and not ".php$" because
some scripts I have are index.php/foo/bar - but I have tried both in
this setup.

2008/05/26 14:47:05 [error] 14777#0: *16744547
"/home/mike/web/" is not
found (2: No such file or directory), client:, server:, request: "GET /category/respect/ HTTP/1.1", host:
"", referrer: ""



server {
                listen 80;
                index index.php index.html;
                root /home/mike/web/;
                include /etc/nginx/defaults.conf;
                include /etc/nginx/expires.conf;
                location ~ \.php {
                        fastcgi_index index.php;
                error_page 404 = /wordpress/index.php?q=$uri;

and i do have this:
fastcgi_param  REDIRECT_STATUS    200;


It does seem that if I do this instead:

if (!-e $request_filename) {
   rewrite ^(.+)$ /wordpress/index.php?q=$1 last;

that it does hand off to fastcgi.

What needs to be done to have this work properly with Igor's suggested
error_page version. Do I need to change WP to throw a header("HTTP 404
not found") or something?

More information about the nginx mailing list