DSR 的 HAPROXY 配置

DSR 的 HAPROXY 配置

我必须使用 HAproxy 在 TCP 模式下进行负载平衡。后端应用程序需要使用客户端源 IP。我在网上找到的唯一解决方案是在 DSR 模式下配置 haproxy。我找到了以下链接 https://www.haproxy.com/blog/layer-4-load-balancing-direct-server-return-mode/它只解释了 Linux 服务器配置,而不是 haproxy 配置,其他地方也没有。如果有人能帮助我完成 DSR 模式的 haproxy 配置,那将非常有帮助。

答案1

对于您的请求,有几种可能的解决方案。

http-request set-src src https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4.2-http-request%20set-src

当目标服务器支持代理协议你可以使用send-proxy https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#5.2-send-proxy

相关内容