Feature request: support for an 'exclude' option on redirection (a.k.a negated regex)
I would like to redirect http to https based on a regex, and exclude one domain.
Something like:
[entryPoints.http.redirect]
regex = "^http://(?!to.exclude.com).*$"
Unfortunately, (?!) is not supported in Go according to https://github.com/google/re2/wiki/Syntax.
Instead of waiting for this support, a feature like exclude could be added into the the traefik.toml config, that would negate regex
@ebreton so your proposal is to add something like:
[entryPoints.http.redirect]
regex = "^http://.*$"
exclude = "^http://to.exclude.com.*$"
Right?
yes :)
@ebreton I think it's a good idea :) We would love to see a PR from you on this ;)
Good. What is the best place to start with ? I am a pythoner, with some curiosity and a good reason to try go now. I guess starting with go is straighforward.
Do you have a cheatsheet to get up to speed with Traefik ?
For this particular feature, would you have a few recommendations for me ?
@ebreton I guess the best advice is to learn by reading the code, especially the section you intend to modify.
If you have questions, don't hesitate to hop on to Slack. The #dev channel is to place to be to ask development-related questions.
Any other workarounds or options to exclude single urls from redirection?
I can not believe this feature is not implemented.
I'm struggling with this too. I'm doing http => https scheme redirection but this breaks the letsencrypt http challenge, thus I want to exclude .well-known/acme-challenge/.* from the redirection but can't seem to construct a regex to do this... Anyone got any workarounds?
I'm struggling with this too. I'm doing http => https scheme redirection but this breaks the letsencrypt http challenge, thus I want to exclude
.well-known/acme-challenge/.*from the redirection but can't seem to construct a regex to do this... Anyone got any workarounds?
did you find any solution for this? I also struggling with same