HAProxy 限制后端服务器的客户端

时间:2021-03-04 12:56:08

标签: haproxy

我想确保每个客户端(IP 地址)在后端使用不同的服务器。 可以在 HAProxy 中做到这一点吗?如果是这样,请发送示例..

我的 HAProxy 配置示例,它将请求转发到外部 http 代理:

global 
 daemon 
 maxconn 256 
 
defaults 
 mode http 
 timeout connect 5000ms 
 timeout client 50000ms 
 timeout server 50000ms 
 
frontend proxy_in 
 bind 0.0.0.0:8080 
 http-request set-header Proxy-Authorization "Basic login:password-in-base64" 
 use_backend proxies_out
 
backend proxies_out 
 cookie SERVERID insert indirect nocache 
 option httpclose 
 option forwardfor header X-Client 
 balance roundrobin 
 mode http 
 server server1 10.10.10.10:8080
 server server2 10.10.10.11:8080

0 个答案:

没有答案