On Fri, Feb 01, 2013 at 02:57:00PM -0500, zacharyalexstern wrote:
I’d like nginx to set a header that contains the IP address of the server
nginx is running on.
There is (almost certainly) not exactly one IP address that fits that
Maybe $server_addr is adequate?
Easiest is probably “proxy_set_header X-Nginx-IP 10.11.12.13;” on the
server that you want to identify as 10.11.12.13.
But if you wind back to why you want that – apache already knows what
ip address the connection to it came from (which should be an address of
the server that nginx is running on).
It would have logged it, except that you configured apache to discard
that address and instead use the content of the X-Real-IP header.
Possibly changing the apache configuration to log the content of the
X-Real-IP header as well as its client ip address is easiest of all.
Whether that is appropriate in your environment depends on what else
your apache does with the information.
Francis D. [email protected]