mirror of
				https://github.com/traefik/traefik.git
				synced 2025-10-31 16:31:16 +01:00 
			
		
		
		
	
		
			
				
	
	
	
		
			1.3 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.3 KiB
		
	
	
	
	
	
	
	
title, description
| title | description | 
|---|---|
| Traefik ReplacePath Documentation | In Traefik Proxy's HTTP middleware, ReplacePath updates paths before forwarding requests. Read the technical documentation. | 
The replacePath middleware will:
- Replace the actual path with the specified one.
- Store the original path in a X-Replaced-Pathheader
Configuration Examples
# Replace the path with /foo
http:
  middlewares:
    test-replacepath:
      replacePath:
        path: "/foo"
# Replace the path with /foo
[http.middlewares]
  [http.middlewares.test-replacepath.replacePath]
    path = "/foo"
# Replace the path with /foo
labels:
  - "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
// Replace the path with /foo
{
  // ...
  "Tags" : [
    "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
  ]
} 
# Replace the path with /foo
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: test-replacepath
spec:
  replacePath:
    path: "/foo"
Configuration Options
| Field | Description | 
|---|---|
| path | The pathoption defines the path to use as replacement in the request URL. |