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: "/"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
              - match:
                  prefix: "/lua-disabled"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                typed_per_filter_config:
                  envoy.filters.http.lua:
                    "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
                    disabled: true
              - match:
                  prefix: "/lua-custom"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                typed_per_filter_config:
                  envoy.filters.http.lua:
                    "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
                    name: hello.lua
              - match:
                  prefix: "/lua-inline"
                route:
                  host_rewrite_literal: upstream.com
                  cluster: upstream_com
                typed_per_filter_config:
                  envoy.filters.http.lua:
                    "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
                    source_code:
                      inline_string: |
                        function envoy_on_response(response_handle)
                          response_handle:logInfo("Goodbye.")
                        end
          http_filters:
          - name: envoy.filters.http.lua
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
              default_source_code:
                inline_string: |
                  function envoy_on_request(request_handle)
                    -- do something
                  end
              source_codes:
                hello.lua:
                  inline_string: |
                    function envoy_on_request(request_handle)
                      request_handle:logInfo("Hello World.")
                    end
                bye.lua:
                  inline_string: |
                    function envoy_on_response(response_handle)
                      response_handle:logInfo("Bye Bye.")
                    end
          - 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
