How to get the ip of the visitors with a loadbalancer
en:How to get the ip of the visitors with a loadbalancer
de:
he:כיצד לקבל את ה-ip של המבקרים עם loadbalancer
ru:Как получить ip посетителей с loadbalancer
ja:ロードバランサーの訪問者の ip アドレスを取得する方法
ar:كيفية الحصول على الملكية الفكرية للزوار مع لوادبالانسير
zh:如何让游客与负载平衡器的 ip
ro:Cum la spre a lua ip vizitatorii cu o loadbalancer
pl:Jak dostać ip odwiedzających z loadbalancer
nl:Hoe krijg ik het ip van de bezoekers met een loadbalancer
it:Come ottenere l'ip dei visitatori con un loadbalancer
pt:Como obter o ip dos visitantes com um balanceador de carga
es:Cómo obtener la ip de los visitantes con un loadbalancer
fr:Comment obtenir l'ip des visiteurs avec un loadbalancer
Introduction
This article describes how to get the IP of the visitors of your web site, when it is behind a loadbalancer with the soluti cloud to ikoul
This approach applies equally to the deployed instances in the public cloud[1] only private cloud[2].
Place
When you use a loadbalancer breast of cloud ikoula, you must know that this last work en NAT routing. Which means that in the logs the final web service, the IP source of visitors that is displayed in the logs corresponds to the IP address of the loadb
To obtain the actual source of the visitors IP address you must use the method X-Forwarded-for in your configuration.
This method is implemented by the module mod_proxy in the version 2.2 Apache.
Make sure that this module is loaded before continuing.
This directive is to be used at the level of the configuration of the for logs. That is at the level of the server configuration or VirtualHost. Depending on your needs and your configuration, you need to change information in the httpd.conf file, apache 2.conf or the file containing the configuration of your host.
By default, apache2 uses the following configuration :
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
Replace by :
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
Once done, your logs will show the real source of your visitors and nor of the loadbalancer IP address.
Conclusion
In the case of a web platform behind a loadbalancer en NAT routing, it is necessary to use the attribute X-Forwarded-for in order to obtain the real source of your visitors IP address in y logs Apache. This configuration can be applied globally or by VirtualHost.
This article seemed you to be u ?
Enable comment auto-refresher