Comments (3)
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.
Related Issues (20)
- Enable STARTTLS for origin Postgres server in TLSRoute of Kubernetes Gateway API HOT 2
- Activate tracing by routers HOT 2
- Timeout (499 Client Closed Request) issue introduced with v2.11.2 (working correctly with all previous versions) HOT 1
- grpc bi directional streaming - READTIMEOUT HOT 1
- Middlewares: IpAllowList doesn't work with localhost HOT 1
- upload file > 2G Fail with traefik 2.11 HOT 4
- Traefik does not attach itself to provided docker networks.
- Run Traefik as windows native service
- Body truncation issue in traffic plugin under certain conditions HOT 1
- Support custom tailscale socket path HOT 5
- customRequestHeaders always overwrite exist header value HOT 1
- traefik 3.0 does not find services on swarm with new syntax HOT 5
- AutoUpdate to V3.0.0, docker won't start, swarmModeRefreshSeconds field not found HOT 3
- Traefik v3 breaks Kubernetes Ingress Prefix Path Regex HOT 6
- v3 breaks TCP route HostSNI having multiple entries HOT 3
- Warning when ExternalName service loading is enabled HOT 2
- Prefer IPv6 option for Service Loadbalancer URL HOT 1
- Issue warning when configuration incompatible with sticky session option is provided HOT 1
- TLS is not working after v3 upgrade HOT 3
- Traefik v3.0.0 breaks video streams HOT 5
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.