
/name/foo/bar?mode=receive-data
두 개의 경로 와 일치하는 작동 중인 Envoy 프록시 구성이 있습니다 /name/receive-data
. Envoy 구성 파일은 다음과 같습니다.
static_resources:
...
filter_chains:
- filters:
- name: envoy.http_connection_manager
typed_config:
...
route_config:
virtual_hosts:
- ...
routes:
- match:
prefix: "/name/foo/bar?mode=receive-data"
...
- match:
prefix: "/name/receive-data"
...
다음에 설명된 대로 일치 prefix
하도록 경로 일치를 사용하여 구성을 업데이트해야 합니다.regex
경로.RouteMatch선적 서류 비치. 이 두 가지 경로 정의는 로 변환되어야 하며 /:name/foo/bar?mode=receive-data
어떻게 /:name/receive-data
든 가 :name
될 수 있습니다 [a-z0-9]
. 나는 이것을 위해 내 자신을 작성하려고 노력했지만 regex:
성공하지 못했으므로 여기에 도움을 주시면 감사하겠습니다.
답변1
주어진 요청과 일치하는 위치를 찾기 위해 nginx는 먼저 접두사 문자열(접두사 위치)을 사용하여 정의된 위치를 확인합니다.
답변2
1.13.1의 문서에 따르면:
- match:
safe_regex:
google_re2: {}
regex: "\/.*\/foo\/bar"
route:
cluster: whatever
- match:
safe_regex:
google_re2: {}
regex: "\/.*\/receive-data"
route:
cluster: somethingelse