我当前的设置
互联网 – 防火墙(MAP到浮动IP) – 浮动IP – HAProxy1 / HAProxy2 – 后端IIS 7.5
后端服务器托pipe许多客户端的内容,代码将删除用户input的URL,并根据用户的期望提供正确的.css。
是否有可能在HAProxy中有一个ACL列表,然后将URL转发到正确的后端。 我当前的configuration适用于基本的URL和代码,但是一旦匹配实际的客户端URL,它就不能工作。
我目前的configuration
global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy stats socket /run/haproxy/admin.sock mode 660 level admin stats timeout 30s user haproxy group haproxy daemon # Default SSL material locations ca-base /etc/ssl/certs crt-base /etc/ssl/private # Default ciphers to use on SSL-enabled listening sockets. # For more information, see ciphers(1SSL). This list is from: # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ # An alternative list with additional directives can be obtained from # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS ssl-default-bind-options no-sslv3 defaults log global mode http option httplog option dontlognull timeout connect 5000 timeout client 50000 timeout server 50000 errorfile 400 /etc/haproxy/errors/400.http errorfile 403 /etc/haproxy/errors/403.http errorfile 408 /etc/haproxy/errors/408.http errorfile 500 /etc/haproxy/errors/500.http errorfile 502 /etc/haproxy/errors/502.http errorfile 503 /etc/haproxy/errors/503.http errorfile 504 /etc/haproxy/errors/504.http frontend WebServers bind *:80 mode http # Define ACL based on host names acl host_www hdr_beg(host) -i www acl host_xml hdr_beg(host) -i xml # Default Route to normal backends use_backend Webroot04 if host_www use_backend Webroot05 if host_xml backend Webroot04 mode http balance roundrobin reqadd X-Forwarded-Proto:\ http option http-server-close option forwardfor server Webroot04-01 10.181.130.77:80 check server Webroot04-02 10.181.130.78:80 check server Webroot04-03 10.181.130.79:80 check server Webroot04-04 10.181.130.80:80 check backend Webroot05 mode http balance roundrobin reqadd X-Forwarded-Proto:\ http option http-server-close option forwardfor server Webroot05-01 10.181.130.81:80 check server Webroot05-02 10.181.130.82:80 check server Webroot05-03 10.181.130.83:80 check server Webroot05-04 10.181.130.84:80 check listen stats bind *:1936 mode http stats enable stats uri /stats