static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address:
        protocol: TCP
        address: 0.0.0.0
        port_value: 10000
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          stat_prefix: ingress_http
          route_config:
            name: local_route
            virtual_hosts:
            - name: local_service
              domains: ["*"]
              routes:
              - match:
                  prefix: "/route0"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                  rate_limits:
                  - actions:
                    - source_cluster: {}
                    - generic_key:
                        descriptor_value: some_value0
              - match:
                  prefix: "/route1"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                  rate_limits:
                  - actions:
                    - source_cluster: {}
                    - remote_address: {}
                    - generic_key:
                        descriptor_value: some_value1
              - match:
                  prefix: "/route2"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                  rate_limits:
                  - actions:
                    - generic_key:
                        descriptor_value: some_value2
                    limit:
                      dynamic_metadata:
                        metadata_key:
                          key: test.filter.key
                          path:
                          - key: test
              - match:
                  prefix: "/route3"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                  rate_limits:
                  - actions:
                    - extension:
                        name: custom
                        typed_config:
                          "@type": type.googleapis.com/envoy.extensions.rate_limit_descriptors.expr.v3.Descriptor
                          descriptor_key: my_descriptor_name
                          text: request.method
              - match:
                  prefix: "/route4"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                  rate_limits:
                  - actions:
                    - extension:
                        name: custom
                        typed_config:
                          "@type": type.googleapis.com/envoy.type.matcher.v3.HttpRequestHeaderMatchInput
                          header_name: x-header-name
          http_filters:
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
  clusters:
  - name: upstream_com
    type: LOGICAL_DNS
    # Comment out the following line to test on v6 networks
    dns_lookup_family: V4_ONLY
    lb_policy: ROUND_ROBIN
    load_assignment:
      cluster_name: service_upstream_com
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: upstream.com
                port_value: 443
    transport_socket:
      name: envoy.transport_sockets.tls
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
        sni: upstream.com
