ECS - rewrite the hostname of an FQDN

In the Traefik ECS provider, is there a way to rewrite the Host header using dockerLabels?

For example, If the request comes to, can I rewrite it to In other words, I just want to append -123 to the hostname of the FQDN.

Hello @vikas027,

I would go with the redirect regexp middleware to do that.

With docker labels:

# Redirect with domain replacement
# Note: all dollar signs need to be doubled for escaping.
  - "traefik.http.middlewares.test-redirectregex.redirectregex.regex=^*)"
  - "traefik.http.middlewares.test-redirectregex.redirectregex.replacement=$${1}"

Hope it helps :smiley:

1 Like

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