Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedirectRegex broken since update to v3.0 #10690

Open
2 tasks done
lazka opened this issue May 4, 2024 · 2 comments
Open
2 tasks done

RedirectRegex broken since update to v3.0 #10690

lazka opened this issue May 4, 2024 · 2 comments
Assignees
Labels
area/middleware kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed.

Comments

@lazka
Copy link

lazka commented May 4, 2024

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you do?

I have the following RedirectRegex config: https://github.com/msys2/msys2-main-server/blob/8330fd44f4fdf76d27200e995fb8494a4006e6c3/docker-compose.yml#L153-L154

This resulted in "https://mingw-w64.org" being redirected to "https://www.mingw-w64.org", among other cases.

Since the update to v3.0 from v2.11.2 this no longer works and requests using "https://mingw-w64.org" no longer get redirected. I've confirmed that downgrading to 2.11 makes things work again.

I couldn't find anything in the migration guide regarding any changes for RedirectRegex, so I'm filing this here.

What did you see instead?

No redirect happening.

What version of Traefik are you using?

3.0.0

What is your environment & configuration?

See the linked docker-compose.yml above

If applicable, please paste the log output in DEBUG level

No response

@pbek
Copy link
Contributor

pbek commented May 4, 2024

I have the same issue after migrating from Traefik v2 to Traefik 3.0, e.g. also with a simple redirect from www.mydomain to mydomain.

Config:

      - traefik.http.middlewares.bekerle-web-2022-www.redirectregex.regex=^(https?://)www.(.*)$$
      - traefik.http.middlewares.bekerle-web-2022-www.redirectregex.replacement=$${1}$${2}
      - traefik.http.middlewares.bekerle-web-2022-www.redirectregex.permanent=true

There was no redirect, the webpage could not be accessed anymore.

There were no docker logs for the traefik container.

@pbek
Copy link
Contributor

pbek commented May 4, 2024

But what did work on Traefik v3 was:

      - traefik.http.middlewares.nextcloud-redirectregex.redirectregex.permanent=true
      - traefik.http.middlewares.nextcloud-redirectregex.redirectregex.regex=^https://(.*)/.well-known/(card|cal)dav
      - traefik.http.middlewares.nextcloud-redirectregex.redirectregex.replacement=https://$${1}/remote.php/dav/

@sdelicata sdelicata added kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. area/middleware and removed status/0-needs-triage labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/middleware kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed.
Projects
None yet
Development

No branches or pull requests

5 participants