The front end is Nginx, the backend is apache,apache by default can only get the address of the front-end proxy IP, but sometimes need to get the real address, this time, we just need to add the RPAF module on the back-end Apache, and configure it.
wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
TAR-XZVF mod_rpaf-0.6.tar.gz
CD mod_rpaf-0.6/
/usr/local/apache/bin/apxs-i-c-n Mod_rpaf-2.0.slo mod_rpaf-2.0.c
Add Apache Configuration
Vi/usr/local/apache/conf/httpd.conf
Include conf/extra/httpd-rpaf.conf
Vi/usr/local/apache/conf/extra/httpd-rpaf.conf
LoadModule Rpaf_module modules/mod_rpaf-2.0.so
Rpafenable on
Rpafsethostname on
Rpafproxy_ips 127.0.0.1 10.8.0.110 # Proxy Server IP address (remember to make corresponding changes)
Rpafheader x-forwarded-for
Check for errors in configuration and restart in effect
#/usr/local/apache/bin/apachectl-t
#/usr/local/apache/bin/apachectl Restart
Troubleshooting:
1. Check that the module is loaded successfully
Httpd-m
2. See if the front end has a configuration
3. See if you forgot to switch to Apache engine (change it in panel-to-system configuration)
Appendix:
View httpd Compilation parameters
View Apache/build/config.nice this file to
Get real IP Address