{"id":13549033,"url":"https://github.com/traefik/plugin-rewritebody","last_synced_at":"2026-01-12T02:50:40.235Z","repository":{"id":40460086,"uuid":"277752089","full_name":"traefik/plugin-rewritebody","owner":"traefik","description":"Rewrite body is a middleware plugin for Traefik which rewrites the HTTP response body by replacing a search regex by a replacement string","archived":false,"fork":false,"pushed_at":"2022-05-07T02:02:08.000Z","size":25,"stargazers_count":57,"open_issues_count":14,"forks_count":22,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-31T06:51:12.375Z","etag":null,"topics":["traefik","traefik-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.traefik.io/plugins/628c9ec2ffc0cd18356a97a2/log4-shell","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traefik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-07T07:49:47.000Z","updated_at":"2025-01-16T12:21:06.000Z","dependencies_parsed_at":"2022-08-09T21:01:27.193Z","dependency_job_id":null,"html_url":"https://github.com/traefik/plugin-rewritebody","commit_stats":null,"previous_names":["containous/plugin-rewritebody"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fplugin-rewritebody","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fplugin-rewritebody/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fplugin-rewritebody/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traefik%2Fplugin-rewritebody/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traefik","download_url":"https://codeload.github.com/traefik/plugin-rewritebody/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249738800,"owners_count":21318504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["traefik","traefik-plugin"],"created_at":"2024-08-01T12:01:17.528Z","updated_at":"2026-01-12T02:50:40.228Z","avatar_url":"https://github.com/traefik.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Rewrite Body\n\nRewrite body is a middleware plugin for [Traefik](https://github.com/traefik/traefik) which rewrites the HTTP response body by replacing a search regex by a replacement string.\n\n## Configuration\n\n### Static\n\n```toml\n[pilot]\n  token = \"xxxx\"\n\n[experimental.plugins.rewritebody]\n  modulename = \"github.com/traefik/plugin-rewritebody\"\n  version = \"v0.3.1\"\n```\n\n### Dynamic\n\nTo configure the `Rewrite Body` plugin you should create a [middleware](https://doc.traefik.io/traefik/middlewares/overview/) in \nyour dynamic configuration as explained [here](https://doc.traefik.io/traefik/middlewares/overview/).\nThe following example creates  and uses the `rewritebody` middleware plugin to replace all `foo` occurrences by `bar` in the HTTP response body.\n\nIf you want to apply some limits on the response body, you can chain this middleware plugin with the [Buffering middleware](https://doc.traefik.io/traefik/middlewares/http/buffering/) from Traefik.\n\n```toml\n[http.routers]\n  [http.routers.my-router]\n    rule = \"Host(`localhost`)\"\n    middlewares = [\"rewrite-foo\"]\n    service = \"my-service\"\n\n[http.middlewares]\n  [http.middlewares.rewrite-foo.plugin.rewritebody]\n    # Keep Last-Modified header returned by the HTTP service.\n    # By default, the Last-Modified header is removed.\n    lastModified = true\n\n    # Rewrites all \"foo\" occurences by \"bar\"\n    [[http.middlewares.rewrite-foo.plugin.rewritebody.rewrites]]\n      regex = \"foo\"\n      replacement = \"bar\"\n\n[http.services]\n  [http.services.my-service]\n    [http.services.my-service.loadBalancer]\n      [[http.services.my-service.loadBalancer.servers]]\n        url = \"http://127.0.0.1\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraefik%2Fplugin-rewritebody","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraefik%2Fplugin-rewritebody","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraefik%2Fplugin-rewritebody/lists"}