Skip to content

Add rewrite-headers plugin#1

Open
pinetops wants to merge 1 commit intomainfrom
add-rewrite-headers-plugin
Open

Add rewrite-headers plugin#1
pinetops wants to merge 1 commit intomainfrom
add-rewrite-headers-plugin

Conversation

@pinetops
Copy link
Member

Summary

  • Adds the traefik-plugin-rewrite-headers plugin to the traefik config
  • Enables per-service Host header rewriting via Docker labels
  • Useful for projects that need a canonical hostname regardless of access method (e.g. *.localhost rewritten to *.u2i.me for Cloudflare tunnel parity)

Example usage (in a project's compose labels)

labels:
  - "traefik.http.routers.myapp.middlewares=myapp-rewrite-host"
  - "traefik.http.middlewares.myapp-rewrite-host.plugin.rewriteheaders.rewrites[0].header=Host"
  - "traefik.http.middlewares.myapp-rewrite-host.plugin.rewriteheaders.rewrites[0].regex=myapp\\.localhost"
  - "traefik.http.middlewares.myapp-rewrite-host.plugin.rewriteheaders.rewrites[0].replacement=myapp.tom.u2i.me"

Test plan

  • Run traefik-dev-proxy restart (or reinstall) and verify traefik starts without errors
  • Verify existing services without the middleware continue to work unchanged

🤖 Generated with Claude Code

Enables per-service Host header rewriting via Docker labels, useful for
projects that need a canonical hostname regardless of access method
(e.g. localhost vs Cloudflare tunnel).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant