I have nginx server that sends 404 errors to apache httpd at 1.1.1.1:8081. How can I pass all original headers to the error server?
I have the following config:
server {
error_page 404 = http://1.1.1.1:8081/404.php?remote=1;
}
When examining headers in 404.php I get client original ip but no cookies from the client; also, I get request uri set to 404.php?remote=1
and not url that caused the 404 error:
<?php
// 404.php file
file_put_content("log.txt", $_SERVER['REQUEST_URI'], FILE_APPEND); // :(
file_put_content("log.txt", $_SERVER['REMOTE_ADDR'], FILE_APPEND); // Ok
file_put_content("log.txt", $_COOKIE['MyCookie'], FILE_APPEND); // :( empty
?>