Another way to debug "File not found" on nginx+php-fpm

The mysterious File not found errors sometimes occur on complex nginx configurations, php-fpm workers only write a "Primary script unknown" message to stderr, thus the information for debugging is limited.

strace can trace I/O operations of any process, with this tool, you will be able to figure out the path php-fpm workers actually tried to read.

Simply use strace -p pid to attach a php-fpm worker, then start requesting on client side.