Skip to content

"request method or response status code does not allow body"Β #16

Open
@ptruman

Description

Hi

I'm trying to rewrite a FreePBX admin page within my Docker container.
I've setup a local CNAME for the container, and use the "addprefix" middleware to add "/admin" to the URL, so that that CNAME always drops to the admin site.

The CDR (call logs) page however, has hardcoded the prefix "/admin/config.php" into it's response, which causes Traefik to fail (/admin/admin doesn't exist). I've tried a combination of regexredirects which don't seem to work, so I'm now trying this plugin

I'm using labels, and have the following ones setup (via Portainer)

traefik.http.middlewares.mw_cdr.plugin.rewritebody.rewrites[0].regex="/admin/config.php"
traefik.http.middlewares.mw_cdr.plugin.rewritebody.rewrites[0].replacement="/config.php"

My traefik toml contains:

[experimental.plugins]
        [experimental.plugins.rewritebody]
                modulename = "github.com/traefik/plugin-rewritebody"
                version = "v0.3.1"

I'm getting the following in my traefik logs

2021/01/01 14:56:12 unable to write rewrited body: http: request method or response status code does not allow body,
2021/01/01 14:56:02 unable to write rewrited body: http: request method or response status code does not allow body,
plugins-storage/sources/gop-608393850/src/github.com/traefik/plugin-rewritebody/rewritebody.go:93:3: panic

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions