【发布时间】:2018-07-13 00:18:14
【问题描述】:
我想使用 haproxy 将 https://myserver/myapplication/ 重定向到 https://myserver.domain.com/myapplication/。
这是我的 haproxy 配置
frontend LB_http
bind 10.123.122.112:80
reqadd X-Forwarded-Proto:\ http
default_backend LB
frontend LB_https
bind 10.123.122.112:443 ssl crt /usr/local/apache2/conf/server.pem
reqadd X-Forwarded-Proto:\ https
default_backend LB
backend LB
redirect scheme https if !{ ssl_fc }
mode http
stats enable
stats hide-version
stats uri /stats
stats realm Haproxy\ Statistics
stats auth haproxy:redhat # Credentials for HAProxy Statistic report page.
balance roundrobin # Load balancing will work in round-robin process.
option httpchk
option httpclose
option forwardfor
server myserver.domain.com myserver.domain.com:80 # backend server.
我已经通过添加以下两行来编辑配置文件
acl no_domain hdr(host) -i myserver
http-request redirect code 301 prefix %[hdr(host)].domain.com%[path] if no_domain
但是现在,当我尝试时
我的服务器/我的应用程序/
我猜该网址多次重定向。它正在将我重定向到像这样的很长的 url
我错过了什么?
【问题讨论】:
标签: apache .htaccess https haproxy httpd.conf