Thanks for your informative description. The code is inside 404.php as I want to get the requested page which led to error page. For example, when accessing test.html which does not exist, I want to echo "test.html" by php code of 404.php Posted at Nginx Forum: http://forum.nginx.org/read.php?2,204171,204203#msg-204203