Keywords in 404.php

etrader nginx-forum at
Mon Jun 6 16:32:22 MSD 2011

In apache, I used to handle 404.php by $url = getenv("REQUEST_URI"); to
get the requested page. Thus, if someone redirected to 404.php from
/test.html, I had a php string containing "test.hetml". This is indeed
due to the mechanism of redirecting by "ErrorDocument 404 /404.php" in

In Nginx, I think the mechanism for "error_page 404 /404.php;" is
different. How I can get the requested page in 404.php ?

Posted at Nginx Forum:,204278,204278#msg-204278

More information about the nginx mailing list