(see edit below)
I have nginx forwarding requests to Apache 2.4 and I'm getting 127.0.0.1 as the value of SERVER_ADDR. The correct IP is available only on HTTP_X_SERVER_ADDRESS.
I have installed the rpaf module, but it only fixed the REMOTE_ADDR value (which was previously also 127.0.0.1 and now is the correct remote IP).
Is there any way to get the correct server IP on SERVER_ADDR?
I have the following config on nginx.conf:
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Server-Address $server_addr;
proxy_set_header Host $host;
EDIT: I just realized that I can use proxy_pass [my-server-ip]
instead of proxy_pass 127.0.0.1
, are there any drawbacks to that?
proxy_pass $scheme://$server_addr$uri
for some of my reverse-proxies and have no issues with it.