我在HA代理中配置了以下规则。我得到当我试着打http://haproxy_ip/serviceHA代理规则 - 404找不到
frontend http-in
bind 10.254.23.225:80
acl has_service path_beg /service
use_backend service_server if has_service
backend service_server
balance roundrobin
cookie SERVERID insert
option httpchk HEAD /check.txt HTTP/1.0
option httpclose
option forwardfor
server server1 192.168.2.1:9000 cookie server1 check
如果直接调用'http://192.168.2.1:9000/service',你有问题吗?如果是这样,你的后端不能正确处理你的请求。 –
后端本身不具有/服务。我使用haproxy在url中拥有虚拟路径。 – Umapathy
感谢它与reqrep ^([^ \] * \ /)service[/]?(.*)\ 1 \ 2 – Umapathy