Get real IP Address

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.