我正在尝试使用 reqrep 重写对HAProxy后端的请求,但似乎不起作用。我希望将前端请求https://server.com/front/
作为https://server.com/test_front/
发送到后端,但似乎不起作用(该请求仍作为/front
发送到nginx)。我的配置:
defaults
log global
mode http
option tcplog
option dontlognull
option redispatch
maxconn 2000
frontend web-secure:
bind *:443 ssl crt /ssl_path
reqadd X-Forwarded-Proto:\ https
acl is_right_server hdr(host) -i server.com
use backend web-server if is_right_server
backend web-server
reqrep ^([^\ :]*)\ /front[/](.*) \1\ /test_front/\2
mode http
balance leastconn
option httpchk GET /test_back/ha-checks
server my-server server.com:443 check sll check check-ssl inter 5000 rise 3 fall 1