HAProxy 配置同一个域,但使用不同的端口

HAProxy 配置同一个域,但使用不同的端口

我有像这样的 haproxy 配置

    frontend http-in
        bind *:80
        bind *:443 ssl crt /etc/ssl/haproxyssl/cert.pem
        mode http
        #default_backend    backend_servers
        option             forwardfor
        acl host_server1 hdr(host) -i lb-web-ui.domain.com
        acl host_server2 hdr(host) -i lb-web-api.domain.com

        use_backend backend_servers1 if host_server1
        use_backend backend_servers2 if host_server2

backend backend_servers1
        mode http
        balance            leastconn
        cookie             SERVER insert indirect nocache
        server             linux101 172.16.200.101:8080 check cookie linux101
        server             linux26 172.16.100.26:8080 check cookie linux26
        stats enable
        stats auth admin:adminpassword
        stats hide-version
        stats show-node
        stats refresh 20s
        stats uri /haproxy?stats

backend backend_servers2
        mode http
        balance            leastconn
        cookie             SERVER insert indirect nocache
        server             linux101 172.16.200.101:5001 check cookie linux101
        server             linux26 172.16.100.26:5001 check cookie linux26

backend backend_servers3
        mode http
        balance            leastconn
        cookie             SERVER insert indirect nocache
        server             linux101 172.16.200.101:5004 check cookie linux101
        server             linux26 172.16.100.26:5004 check cookie linux26

我想将我的 backend_servers3 设置为前端 https://lb-web-api.domain.com:(自定义端口)。我该如何配置它?

相关内容