Redirect to internal website from Regexp

Hello,

I have a situation where my traefik container has a wildcard domain entry on domain1.
Domain2 is an internal domain, not accessible from the outside.

I'd like to setup a catchall from a regexp, where a client who contacts my traefik on :

https://pattern-blabla.domain1.com
remains on that URL, but the servers URL the traefik is querying is https://pattern-blabla.domain2.local

And I want this to be dynamic, where I would just setup a Regexp Host https://pattern-*.domain1.com

Is this achievable through traefik services & regexps?

Check HostRegexp for the rule in router. You can just define 2 routers, one external, one internal.

2 routers ? I want to redirect requests coming with a target domain1 to domain2, but not rewriting the URL. I would assume a middleware would be necessary, but I don't get the 2 routers, how would that work?

I don’t think you can have „dynamic“ targets. The Traefik router uses a service that uses a loadbalancer with fixed URL(s). You can not change the target per request.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.