我在GCE上有这样的结构(我将使用LB进行网络加载平衡器):
客户请求 - > LB - >实例上的Apache Web服务器 - >代理到另一个LB(请求到达另一个实例)。
请求流程。是否可以将原始请求地址记录到最终实例。
答案 0 :(得分:1)
有多种选择,具体取决于您希望如何配置系统。
一个选项是configure Apache to set the X-Forwarded-For header,然后目标系统需要将该标头记录为源IP。
另一种选择是在Apache服务器上设置canIpForward属性,configure a routing rule on the target instance通过Apache服务器发送其互联网流量,并配置Apache服务器以实现透明负载平衡(可能通过iptables重写规则 - 有关Apache Traffic Server的类似设置,请参阅this page。
根据您要使用Apache服务器的内容,您可能还需要考虑使用GCE HTTP load-balancer,其缩放为1 million qps。