Hello. I am trying to use Traefik to proxy requests transparently from:
https://subdomain.example.com/my/path
to https://internet.com/static/subdomain/my/path
The closest i've found is RedirectRegexp, but that only generates a 302 Location redirect.
Is it possible to use regex at the service level?
Are you asking how to do that redirect so that it would work for any arbitrary "subdomain" part, i.e. any first subdomain part would dynamically become the second element of the path prefix? If yes, I do not think that is possible to do.
Hey mpl.
I wanted to proxy it dynamically with regex, but soon found out that Traefik didn't support that. I solved the problem by placing an Nginx proxy as a Traefik service and letting Nginx handle the proxying instead of Traefik.
Inside Nginx, I get the complete URL by looking in $http_x_forwarded_host, and doing regex on that variable. Then I just proxy_pass to the wanted URL based on the result of the regular expression.
Hi @mpl. We have the same scenario as csamu. Do we have a plan to implement this feature in Traefik? Otherwise, we need to add additional hop (from traefik to nginx).