我的haproxyconfiguration看起来像redirect到5601为kibana不起作用。 为什么?
########################################################################## defaults mode http log global option httplog timeout connect 10s timeout client 30s timeout server 30s frontend http-in bind *:80 acl main path_beg -i /main acl kibana path_beg -i /kibana redirect location main if !main use_backend kibana-backend if kibana default_backend application-backend backend application-backend mode http balance leastconn option httpclose option forwardfor stats uri /haproxy?stat stats enable cookie JSESSIONID prefix server app1 172.168.1.1:80 maxconn 32 check inter 5000 cookie my.site.ru backend kibana-backend mode http option forwardfor http-request set-header X-Forwarded-Port %[dst_port] server kibana 172.168.1.2:5601 maxconn 32 check inter 5000 cookie ki.site.ru
尝试这个。
frontend main *:80 acl url_kibana path_beg -i /kibana use_backend kibana if url_kibana backend kibana mode http reqrep ^([^\ ]*)\ /kibana[/]?(.*) \1\ /\2 server xxxx:5601
testingHAProxyconfiguration:
haproxy -c -V -f /etc/haproxy/haproxy.cfg
重新启动HAProxy:
systemctl restart haproxy
原来的答案和解释在: https : //stackoverflow.com/questions/36266776/kibana-server-basepath-results-in-404