【发布时间】:2015-12-15 17:20:45
【问题描述】:
我有 2 个虚拟主机
app.example.com:80 在 IP 地址xxx.xxx.xxx.xxx
app2.example.com:80 在 IP 地址yyy.yyy.yyy.yyy
我的 haproxy ipaddress 是sss.sss.sss.sss
这是 haproxy 配置:
global
log 127.0.0.1 local0 notice
maxconn 2000
user haproxy
group haproxy
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000
frontend www-http
mode http
bind *:80
default_backend appname
stats enable
stats uri /haproxy?stats
stats auth admin:password
stats show-node
backend appname
balance roundrobin
option httpclose
option forwardfor
server lamp1 app.example.com:80 check
server lamp2 app2.example.com:80 check
当尝试使用 haproxy ipaddress 访问时,网络浏览器返回 xampp 仪表板而不是后端内容。
如何让 haproxy 重定向到后端内容?
【问题讨论】:
-
在后台加
http-request set-header Host app.example.com或许?
标签: networking haproxy