This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Log the IP of the client in Apache using the CloudStack LoadBalancer
Skip to end of metadata
Go to start of metadata

Preparing The Backend Web Servers

When you use the Loadblancer the original IP address it will pass on a field called X-Forwarded-For to the backend web servers. Of course, the backend web servers should log the original user's IP address in their access logs instead of the IP addresses of our load balancers. Therefore we must modify the LogFormat line in /etc/apache2/apache2.conf and replace %h with  %{X-Forwarded-For}i

You need to change this line on the httpd.conf or apache2.conf 

#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

If you not use this log format you will see the internal IP of the loadbalancer in yours logs.

  • No labels