任何帮助都能收到!我在docker中运行haproxy,并且可以正常访问默认的Web服务器,但是当我尝试通过ACL路由到相同的Web服务器IP时,我得到:-
This site can’t be reached localhost refused to connect.
Search Google for localhost router
ERR_CONNECTION_REFUSED
http://localhost-正常 http://localhost/router-是否起作用:-(
我尝试过path_beg,peth_end无济于事
global
#log /dev/log local0
#log localhost local1 notice
maxconn 2000
daemon
defaults
#log global
mode http
#option httplog
#option dontlognull
retries 3
timeout connect 5000
timeout client 50000
timeout server 50000
frontend http-in
bind *:80
acl url_router path_beg -i /router
use_backend srvs_app1 if url_router
default_backend webservers
#acl app2 path_end -i /multiviewer
#use_backend srvs_app2 if app2
backend srvs_app1 #backend that lists your servers. Use a balancing algorithm as per your need.
balance roundrobin
option httpchk
option forwardfor
option http-server-close
server router1 ${ROUTER_1_IP}:${APACHE_EXPOSED_PORT} check
server router2 ${ROUTER_2_IP}:${APACHE_EXPOSED_PORT} check
backend webservers
stats enable
stats auth admin:admin
stats uri /haproxy?stats
balance roundrobin
option httpchk
option forwardfor
option http-server-close
server apache1 ${ROUTER_1_IP}:${APACHE_EXPOSED_PORT} check
server apache2 ${ROUTER_2_IP}:${APACHE_EXPOSED_PORT} check