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

相關內容