본문 바로가기
WIKI 기술 지식 베이스

ReplacePath

원문 보기 위키 갱신

출처: Traefik ReplacePath Documentation

본문

ReplacePath

replacePath 미들웨어는 다음을 수행해요:

  • 실제 경로를 지정된 경로로 바꿉니다.

  • 원래 경로를 X-Replaced-Path 헤더에 저장합니다.

구성 예시

구조화된 (YAML)

# 경로를 /foo로 바꿈
http:
  middlewares:
    test-replacepath:
      replacePath:
        path: "/foo"

구조화된 (TOML)

# 경로를 /foo로 바꿈
[http.middlewares]
  [http.middlewares.test-replacepath.replacePath]
    path = "/foo"

Labels

# 경로를 /foo로 바꿈
labels:
  - "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"

Tags

// 경로를 /foo로 바꿈
{
  // ...
  "Tags" : [
    "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
  ]
} 

Kubernetes

# 경로를 /foo로 바꿈
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: test-replacepath
spec:
  replacePath:
    path: "/foo"

구성 옵션

| Field | Description | | path | path 옵션은 요청 URL에서 치환으로 사용할 경로를 정의해요. |

더 알아보기 (Learn more)