plugin-rewritebody icon indicating copy to clipboard operation
plugin-rewritebody copied to clipboard

Error in parcing

Open Thesam1798 opened this issue 4 years ago • 2 comments

Background :

Traefik : latest Provider : File and Docker Server's OS: Ubuntu 20.04

Rewrite configuration :

[http.middlewares]
  [http.middlewares.rewrite-foo.plugin.rewritebody]
    lastModified = false

    [[http.middlewares.rewrite-foo.plugin.rewritebody.rewrites]]
      regex = 'http://'
      replacement = 'https://'

Docker configuration :

services:
  test:
    container_name: test
    image: thesam1798/liberty:web
    depends_on:
      - reverse-proxy
    volumes:
      - "/srv/docker/www/test:/app"
    labels:
      - "traefik.enable=true"

      - "traefik.http.routers.gestion.rule=Host(`XXXXXXXXXXXXX`)"
      - "traefik.http.routers.gestion.entrypoints=websecure"
      - "traefik.http.routers.gestion.tls=true"
      - "traefik.http.routers.gestion.tls.certresolver=sslresolver"

      - "traefik.http.routers.gestion.middlewares=rewrite-foo@file"
      - "traefik.http.middlewares.gestion-middlewares.compress=true"

Describe the bug

Parcing works but not every time

To Reproduce

it doesn't work : in index.html :

<body class="ini-expand-fea">
	TEST|http://|TEST
</body>

http://

to make it work remove any character

Screen

2021-03-08_12-45

Thesam1798 avatar Mar 08 '21 12:03 Thesam1798

Hey, i have the same problem

Zomblard avatar Mar 08 '21 12:03 Zomblard

[http.middlewares] [http.middlewares.rewrite-foo.plugin.rewritebody] lastModified = false

[[http.middlewares.rewrite-foo.plugin.rewritebody.rewrites]]
  regex = 'http://'
  replacement = 'https://'

Try the following configuration.

[http.middlewares]
  [http.middlewares.rewrite-foo.plugin.rewritebody]
    lastModified = false

    [[http.middlewares.rewrite-foo.plugin.rewritebody.rewrites]]
      regex = 'http:\/\/'
      replacement = 'https:\/\/'

wangfeng22 avatar Jun 20 '22 07:06 wangfeng22