byjg / docker-easy-haproxy

Discover services and create dynamically the haproxy.cfg based on the labels defined in docker containers or from a simple static Yaml
MIT License
56 stars 13 forks source link

support multi containers #10

Closed Ox0400 closed 2 years ago

Ox0400 commented 2 years ago

support multi containers like this


frontend http_in_80_1
    bind *:80
    mode http

    acl is_rule_localhost_80_1_1 hdr(host) -i localhost
    acl is_rule_localhost_80_1_2 hdr(host) -i localhost:80
    use_backend srv_localhost_80_1 if is_rule_localhost_80_1_1 OR is_rule_localhost_80_1_2

backend srv_localhost_80_1
    balance roundrobin
    mode http
    option forwardfor
    http-request set-header X-Forwarded-Port %[dst_port]
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    server a0b8ccb2d40f:80 a0b8ccb2d40f:80 check weight 1
    server f718c6f0f6c3:80 f718c6f0f6c3:80 check weight 1
byjg commented 2 years ago

Thank you for your PR. I am analyzing it, meanwhile, could you back merge from master? I added today the GitHub actions test and build.

byjg commented 2 years ago

Thank you. I am merging and soon creating a release tag

byjg commented 2 years ago

Docker image built.

The tags latest and 3.0.2 now contain mult-containers. Thanks.