I'm trying to set up a global location
in nginx. It all works perfectly right now, other than PHP scripts requiring fastcgi. They're running a 404.
Is there a way I can see the exact path it's accessing so I can try to debug this a bit and figure out what I'm doing wrong?
There is no access log for FastCGI, because it isn't a program, it's a protocol. For debugging the PHP fastcgi handler, I've usually resorted to
strace
-- it usually shows me what file is trying to be accessed, and it's not hard to work out how it went wrong from there. Nginx's request processing debug logging is often instructive, too.Using strace for this is pretty straightforward -- you just strace the PHP FCGI workers and limit yourself to read/write calls with
-e trace=read,write
. Upping the string print size with-s 4096
is also a good idea, so you get the entire FCGI packet rather than just the first few bytes.Another way would be enable debug mode in error_log directive, see http://wiki.nginx.org/CoreModule#error_log
error_log error.log debug;
would produce more information on what happens inside nginx, but not fastcgi.
Some more info on http://wiki.nginx.org/Debugging also.