Comments (4)
Hello,
I'm not able to reproduce your issue:
dynamic configuration
http:
middlewares:
en-redirect-regex:
replacePathRegex:
regex: "^/en(/(.*))?$"
replacement: "/$2"
routers:
example:
rule: "PathPrefix(`/`)"
service: foo
middlewares:
- en-redirect-regex
services:
foo:
loadBalancer:
servers:
- url: http://localhost:9092
static configuration
providers:
file:
directory: ./temp/
entryPoints:
web:
address: :9090
$ curl http://localhost:9090/en/any/path
IP: 127.0.0.1
IP: ::1
RemoteAddr: [::1]:38028
GET /any/path HTTP/1.1 ## <------------------
Host: localhost:9090
User-Agent: curl/8.6.0
Accept: */*
Accept-Encoding: gzip
X-Forwarded-For: ::1
X-Forwarded-Host: localhost:9090
X-Forwarded-Port: 9090
X-Forwarded-Proto: http
X-Real-Ip: ::1
X-Replaced-Path: /en/any/path
$ curl http://localhost:9090/en/any/path/
IP: 127.0.0.1
IP: ::1
RemoteAddr: [::1]:44142
GET /any/path/ HTTP/1.1 ## <------------------
Host: localhost:9090
User-Agent: curl/8.6.0
Accept: */*
Accept-Encoding: gzip
X-Forwarded-For: ::1
X-Forwarded-Host: localhost:9090
X-Forwarded-Port: 9090
X-Forwarded-Proto: http
X-Real-Ip: ::1
X-Replaced-Path: /en/any/path/
from traefik.
@ldez thank you for the quick response!
I use this middleware in another docker swarm stack this way:
- traefik.http.routers.name.middlewares=en-redirect-regex@file
Maybe it's about this...
One more observation, if I change replacement: "/$2"
to replacement: "//$2"
it starts work right.
from traefik.
The provider doesn't change the behavior of the middleware.
Can you provide a full, but minimal, reproducible example?
from traefik.
Hi! I'm Træfiker 🤖 the bot in charge of tidying up the issues.I have to close this one because of its lack of activity 😞Feel free to re-open it or join our Community Forum.
from traefik.
Related Issues (20)
- Nested traefik instances with "remote error: tls: unrecognized name" HOT 5
- defaultRule migrate from v2 to v3 ("error while adding rule Host: unexpected number of parameters; got 2, expected one of [1]) HOT 2
- "A new release has been found: 3.0.4. Please consider updating." Doesn't reference Traefik HOT 8
- Latest release in github currently points to a release candidate v3.1.0-rc3 HOT 1
- Bad UX in documentation banner images ` HOT 2
- Default Certificate Overridden by Team-Specific Secret with Same Cert but Incomplete Chain in IngressRoute HOT 6
- Provide JSON scheme for new Traefik v3 TOML formatting HOT 4
- File provider parsing errors should be limited to a single file HOT 2
- ServiceURL format in access logs HOT 3
- v3.x prometheus metrics returns wrong service name exclusively for the 'traefik_service_server_up' metric. HOT 1
- Error logs when kubernetes endpoints are scaled down to 0 HOT 6
- A way that allows active closing of connections, similar to the 444 status code in nginx HOT 3
- Authorisation header gets added to every second request
- Traefik Ingress Controller Fails with 404 errors due to plugin download failure HOT 1
- Allow to define different serviceName for OTLP metrics HOT 3
- Security vulnerability on Alpine Linux HOT 5
- Connection refused from container to container communication HOT 10
- [ECS] Dynamic Port for healthcheck service option HOT 1
- Errors on receving sigterm HOT 1
- Server reported as OK when it is not HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traefik.