简体   繁体   English

如果通过ARR路由,如何获取客户端IP地址

[英]How to get client IP address if it is routed by ARR

The IP on the service machine that is logged is IP of ARR server machine, not of the end client. 记录的服务计算机上的IP是ARR服务器计算机的IP,而不是最终客户端的IP。 How to get the actual client IP on the end server doing the work? 如何获得最终服务器上的实际客户端IP进行工作?

The X-Forwarded-For (XFF) HTTP header field is a de facto standard for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or load balancer. X-Forwarded-For (XFF)HTTP标头字段是一种事实上的标准,用于标识通过HTTP代理或负载平衡器连接到Web服务器的客户端的原始IP地址。

This setting should be configurable based on what type of proxy or loadbalancer you are using. 此设置应基于您使用的代理或负载均衡器的类型进行配置。 Thus, you can determine the client IP by inspecting the HTTP header on the server. 因此,您可以通过检查服务器上的HTTP标头来确定客户端IP。 Check the ARR config if use x-forwarded-for is enabled. 如果启用了x-forward-for,请检查ARR配置。

There are also options in IIS to log the client IP address if XFF is utilized. 如果使用XFF,则IIS中还有一些选项可以记录客户端IP地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM