“如何让游客与负载平衡器的 ip”的版本间的差异
第1行: | 第1行: | ||
+ | <span data-link_translate_es_title="Cómo obtener la ip de los visitantes con un loadbalancer" data-link_translate_es_url="C%C3%B3mo+obtener+la+ip+de+los+visitantes+con+un+loadbalancer"></span>[[:es:Cómo obtener la ip de los visitantes con un loadbalancer]][[es:Cómo obtener la ip de los visitantes con un loadbalancer]] | ||
<span data-link_translate_en_title="How to get the ip of the visitors with a loadbalancer" data-link_translate_en_url="How+to+get+the+ip+of+the+visitors+with+a+loadbalancer"></span>[[:en:How to get the ip of the visitors with a loadbalancer]][[en:How to get the ip of the visitors with a loadbalancer]] | <span data-link_translate_en_title="How to get the ip of the visitors with a loadbalancer" data-link_translate_en_url="How+to+get+the+ip+of+the+visitors+with+a+loadbalancer"></span>[[:en:How to get the ip of the visitors with a loadbalancer]][[en:How to get the ip of the visitors with a loadbalancer]] | ||
<span data-link_translate_ru_title="Как получить ip посетителей с loadbalancer" data-link_translate_ru_url="%D0%9A%D0%B0%D0%BA+%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B8%D1%82%D1%8C+ip+%D0%BF%D0%BE%D1%81%D0%B5%D1%82%D0%B8%D1%82%D0%B5%D0%BB%D0%B5%D0%B9+%D1%81+loadbalancer"></span>[[:ru:Как получить ip посетителей с loadbalancer]][[ru:Как получить ip посетителей с loadbalancer]] | <span data-link_translate_ru_title="Как получить ip посетителей с loadbalancer" data-link_translate_ru_url="%D0%9A%D0%B0%D0%BA+%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B8%D1%82%D1%8C+ip+%D0%BF%D0%BE%D1%81%D0%B5%D1%82%D0%B8%D1%82%D0%B5%D0%BB%D0%B5%D0%B9+%D1%81+loadbalancer"></span>[[:ru:Как получить ip посетителей с loadbalancer]][[ru:Как получить ip посетителей с loadbalancer]] |
2015年11月18日 (三) 13:53的版本
es:Cómo obtener la ip de los visitantes con un loadbalancer
en:How to get the ip of the visitors with a loadbalancer
ru:Как получить ip посетителей с loadbalancer
ja:ロードバランサーの訪問者の ip アドレスを取得する方法
ar:كيفية الحصول على الملكية الفكرية للزوار مع لوادبالانسير
fr:Comment obtenir l'ip des visiteurs avec un loadbalancer
这篇文章是从由软件进行自动翻译。你可以看到这篇文章的源代码
介绍
这篇文章描述如何获取您的 web 站点的访客的 IP,当它是在后面 loadbalancer 与解决方案 cloud 到 ikoula。
这种方法同样适用于中的已部署实例 {{cloud public}} 只有 {{cloud privé}}.
地方
当您使用的负载平衡器乳房 cloud ikoula,你必须知道这最后的工作 en NAT routing.这就意味着在 logs 最终的 web 服务,游客中显示 IP 源 logs 对应于负载均衡器的 IP 地址。
若要获取访客的 IP 地址的实际来源必须使用方法 X 转发为 在您的配置。
此方法实现由模块 mod_proxy 在版本 2.2 Apache。
请确保在继续之前装载此模块。
此指令是用于配置格式的一级 logs.这就是级别的服务器配置或 虚拟主机 .根据您的需求和您的配置,您需要更改信息在 httpd.conf 文件中,apache 2.conf 或其中包含的您的主机配置文件。
默认情况下,apache 2 使用以下配置 :
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
一旦完成,您的日志将显示你的访客的真正来源,也不是负载平衡器的 IP 地址。
结论
在后面的 web 平台 loadbalancer en NAT routing它是需要使用属性 X 转发为 为了获得您的访客 IP 地址中的真正来源你 logs Apache。此配置可以全局地应用或由 虚拟主机 .
这篇文章似乎你要有用 ?
开启评论自动刷新