![Haproxy ProxyPass 和 ReverseProxy](https://linux22.com/image/734224/Haproxy%20ProxyPass%20%E5%92%8C%20ReverseProxy.png)
我有一个带有以下指令的 Apache vhost;
ProxyPass "/String1" "http://10.0.1.50:8081/String1/String2/String3
ProxyPassReverse "/String1" "http://10.0.1.50:8081/String1/String2/String3"
ProxyPass "/String2" "http://10.0.1.100:8080/String1/String2/String3
ProxyPassReverse "/String2" "http://10.0.1.100:8080/String1/String2/String3
我如何在 Haproxy 中执行此操作?我尝试了以下方法;
Frontend Apache
bind *:8993
mode http
option httplog
option httpclose
option http-server-close
option forwardfor
acl url_string1 path_beg /String1
acl url_string2 path_beg /String2
use_backend string1 if url_string1
use_backend string2 if url_string2
backend string1
mode http
server string1 10.0.1.50:8081/String1/String2/String3
backend string2
mode http
server string2 10.0.1.100:8080/String1/String2/String3
但它不起作用。我希望有人能帮助我,因为这真的让我很恼火。