【发布时间】:2016-12-31 04:54:58
【问题描述】:
我是 HAProxy 的新手。我尝试配置 HAProxy 以将 URL 转发到特定的 URI。 比如我的网址是https://www.example.com,我想转发到https://www.example.com/aks/
我的 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
【问题讨论】:
标签: haproxy