Http HAProxy上的重定向
我试图在ApacheHaproxy中复制以下配置,但到目前为止没有成功Http HAProxy上的重定向,http,redirect,centos,haproxy,Http,Redirect,Centos,Haproxy,我试图在ApacheHaproxy中复制以下配置,但到目前为止没有成功 <VirtualHost *:80> ProxyPreserveHost On ServerName alpha.app.int ProxyPass / http://127.0.0.1:8080/app/ ProxyPassReverse / http://127.0.0.1:8080/app/ </VirtualHost> 你可以试试: frontend app
<VirtualHost *:80>
ProxyPreserveHost On
ServerName alpha.app.int
ProxyPass / http://127.0.0.1:8080/app/
ProxyPassReverse / http://127.0.0.1:8080/app/
</VirtualHost>
你可以试试:
frontend app
bind *:80
acl path_root path /
redirect location https://www.example.com/app/ if path_root
default_backend app
backend app
mode http
option forwardfor
server alpha 127.0.0.1:8080
谢谢你,伙计,你的解决方案非常有效。但是我认为它在.com之后的重定向属性值中有额外的斜杠。你的解决方案对我非常有用,但是现在我需要对它进行一些调整,我需要它让客户端在url中只看到地址,而不是,你知道我如何重写url吗?
frontend app
bind *:80
acl path_root path /
redirect location https://www.example.com/app/ if path_root
default_backend app
backend app
mode http
option forwardfor
server alpha 127.0.0.1:8080