I have an Apache 2.4 with PHP 5.4 application using extensive use of
The infrastructure is going through changes and recently we deployed an Nginx acting as reverse proxy. The proxy is properly adding
X-Forwarded-For headers, both showing the real client IP. For portability, we have also containerized both the Apache/PHP application and the Nginx proxy. They are deployed in two different hosts that communicate to each other through external IPs (will be changed to a private network in the future).
I cannot modify the application, but I can modify the Apache configuration.
I have enabled remoteip module, which is a replacement for mod_rpaf. I have tried several configurations such as:
RemoteIPProxiesHeader X-Forwarded-For RemoteIPInternalProxy <external ip of the proxy>
RemoteIPProxiesHeader X-Forwarded-For RemoteIPTrustedProxy <external ip of the proxy>
And some combinations of the
In any case, when running
phpinfo() I get the following output:
HTTP_X_REAL_IP <my real client ip> HTTP_X_FORWARDED_FOR <my real client ip> SERVER_ADDR <the Apache/PHP docker machine's ip> REMOTE_ADDR <external ip of the proxy>
Any idea on how to properly configure the the remoteip module?