익명 18:36

Envoy proxy match route using regex

Envoy proxy match route using regex

I have a working Envoy proxy configuration that matches two routes /name/foo/bar?mode=receive-data and /name/receive-data. The Envoy configuration file looks something like this:

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"
                ...

I need to update the configuration from using route prefix matching to regex match as explained in the route.RouteMatch documentation. These two route deinitions must be converted to /:name/foo/bar?mode=receive-data and /:name/receive-data somehow, where :name can be [a-z0-9]. I've tried to write my own regex: for this, but with no success, so I'd appreciate some help here.



Top Answer/Comment:

To find location matching a given request, nginx first checks locations defined using the prefix strings (prefix locations).

상단 광고의 [X] 버튼을 누르면 내용이 보입니다