从负载均衡器获取原始 IP [英] Getting Orgin IP From Load Balancer

查看:32
本文介绍了从负载均衡器获取原始 IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从带有 GCloud 的 HTTP 负载均衡中获取用户的原始 IP?我们目前只使用网络负载平衡,虽然我们需要用户的 IP 以进行合规性和日志记录,但需要转移到跨区域平衡器.

Is there a way to get the origin IP of the user from the HTTP load balancing w/ GCloud? We are currently using just Network Load Balancing, and are needing to move to a cross region balancer although we need to user's IP for compliance and logging.

它是否传递了标题或类似的内容?

Does it pass in a header or something along those lines?

谢谢~Z

推荐答案

文档 (https://cloud.google.com/compute/docs/load-balancing/http/) 表示这是 X-Forwarded-For 标头的第一个 IP 地址.

The documentation (https://cloud.google.com/compute/docs/load-balancing/http/) says it's the first IP address of the X-Forwarded-For header.

  X-Forwarded-For: <client IP(s)>, <global forwarding rule external IP>

这篇关于从负载均衡器获取原始 IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆