I use NGINX as reverse proxy for apache. However, when visiting, the
REMOTE_ADDR variable is 127.0.0.1 (in web-applications). Yes,
HTTP_X_FORWARDED_FOR sees my IP, but how can i force that
REMOTE_ADDR was same too?
There is specific module for that: mod remoteip
This module is used to treat the useragent which initiated the request as the originating useragent as identified by httpd for the purposes of authorization and logging, even where that useragent is behind a load balancer, front end server, or proxy server.
The module overrides the client IP address for the connection with the useragent IP address reported in the request header configured with the
You probably should not allow any client to set the X-forwarded-For header and only trust the header value when the requests comes from your (reverse) proxy by adding an ACL with trusted hosts with the