1
我是HAProxy的新手。我試圖配置HAProxy將URL轉發到特定的URI。 例如,我的網址是https://www.example.com,我想將它轉發到https://www.example.com/aks/將默認URL轉發到HAProxy中的特定URI
我HAProxy的配置是:
frontend Listen443
bind *:443 ssl crt /etc/ssl/certs/example.com-wildcard.pem
acl web_url path_beg /aks
use_backend WEB if web_url
default_backend WEB
# Send traffic to the web layer on port 8080
backend WEB
mode http
balance roundrobin
option httpclose
cookie SERVERIDWEB insert indirect nocache secure
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
server app-1 app1.example.com:8080 check cookie app1web
server app-2 app2.example.com:8080 check cookie app2web
server app-3 app3.example.com:8080 check cookie app3web
其實,'is_root -i /'不起作用,因爲它出現了,即使瀏覽器欄中沒有顯示,也有可能是/HTTP1.1 –