Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Redirect of top level domain and subdomains -> too many redirects (different backends)

$
0
0

I am currently trying to figure out if the software itself causes the problem or the configuration I wrote in HAProxy, so apologies if it’s not HAProxy related.

I need to redirects to two different services in Docker Swarm, one of them should be selected when the toplevel domain (e.g. institute.org), the other when a subdomain (e.g. internal.institute.org) is used. I am pretty sure it’s a common thing but I get “too many redirects” in the browser, so apparently something goes wild and ends up in an infinite loop.

Here is my latest try :wink:

acl ACL_internal.institute.org hdr(host) -i internal.institute.org
acl ACL_institute.org hdr(host) -i institute.org
use_backend be_internal.institute.org if ACL_internal.institute.org
use_backend be_institute.org if ACL_institute.org !ACL_internal.institute.org

and then down the line (but this shouldn’t be the problem)

backend be_institute.org
    balance roundrobin
    dynamic-cookie-key INSTITUTE
    cookie SRVID insert dynamic
    option httpchk HEAD /
    default-server check maxconn 20
    server-template some-service- 1 some-service_foo:80 check resolvers docker init-addr libc,none

backend be_internal.institute.org
    balance roundrobin
    dynamic-cookie-key OPENDATAKM3NET
    cookie SRVID insert dynamic
    option httpchk HEAD /
    default-server check maxconn 20
    server-template some-service- 1 some-service_foo:42023 check resolvers docker init-addr libc,none

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>