标签:color class sock bin div app 配置文件 upgrade proxy
配置文件位置:/etc/haproxy/haproxy.cfg
Reqrep 正则重写
配置详情:
1 Frontend App *:80 2 acl uri_api path_beg /api/ 3 acl uri_web path_beg / 4 acl uri_docs path_beg /docs/ 5 acl uri_socket hdr(Upgrade) -i Websocket 6 acl uri_socket hdr_beg(Host) -i ws 7 8 Use_backend api if uri_api 9 Use_backend socket if uri_socket 10 Use_backend web if uri_web 11 Use_backend docs if uri_docs 12 13 Backend api 14 balance roundrobin 15 reqrep ^([^\ ]*\ /)api[/]?(*) \1\2 16 server server1 10.0.0.1:8080 check 17 18 Backend socket 19 balance roundrobin 20 timeout queue 1h 21 timeout server 1h 22 timeout connect 1h 23 server server1 10.0.0.1:8443 check 24 25 Backend web 26 balance roundrobin 27 server server1 10.0.0.2:8080 check 28 29 Backend docs 30 balance roundrobin 31 server server1 10.0.0.2:8080 check
标签:color class sock bin div app 配置文件 upgrade proxy
原文地址:https://www.cnblogs.com/reboot777/p/10305106.html