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
.htaccess
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: