mod_rpaf is an apache module that translate proxy IP to real IP when apache web server is behind a proxy server.
https://github.com/gnif/mod_rpaf/
To install on Ubuntu, run
apt install -y libapache2-mod-rpaf
Config file available at
root@vps528168:~# cat /etc/apache2/mods-enabled/rpaf.conf RPAFenable On # When enabled, take the incoming X-Host header and # update the virtualhost settings accordingly: RPAFsethostname On # Define which IP's are your frontend proxies that sends # the correct X-Forwarded-For headers: RPAFproxy_ips 127.0.0.1 ::1 193.70.86.5 # Change the header name to parse from the default # X-Forwarded-For to something of your choice: RPAFheader X-Real-IP root@vps528168:~#