How to obtain the real ip address in the case of Server Load balancer

Source: Internet
Author: User

1. open the file:/etc/httpd/conf/httd. conf. 2. Find "CustomLog" in the file and find the following configuration block: Check that the currently used LogFormat is "combined" (if other log formats are enabled, replace the corresponding format definition ).
#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined3. Search for "LogFormat" in the file and find the following configuration block (defined in combined format ): logFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "" combined: logFormat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-Agent} I \ "\" % {X-Forwarded-For} I \ "" combined 4. Save and close the file/etc/httpd/conf/httd. conf. 5. Restart the Apache service. Note that the variables in braces in the third article must correspond to the server. If you do not know, you can get the variables in phpinfo or similar information!

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.