title: Envoy reverse proxy
body: <p>In my Apache conf I have this line which I can‘t change</p>
  <pre><code>ProxyPass /foo http://localhost:10000 nocanon
  </code></pre>
  <p>I‘ve got an envoy instance listening on 10000. When I access <a href="http://example.com/foo" rel="nofollow noreferrer">http://example.com/foo</a> I get a referer to /app which leads to <a href="http://example.com/app" rel="nofollow noreferrer">http://example.com/app</a>. Under <a href="http://example.com/app" rel="nofollow noreferrer">http://example.com/app</a> there is nothing. How do I tell envoy to make this to <a href="http://example.com/foo/app" rel="nofollow noreferrer">http://example.com/foo/app</a></p>
  <p>Here is the relevant part of my envoy.yaml</p>
  <pre><code>static_resources:
    listeners:
    - name: main_listener
      address:
        socket_address: { address: 0.0.0.0, port_value: 10000 }
      filter_chains:
      - filters:
        - name: envoy.filters.network.http_connection_manager
          typed_config:
            &quot;@type&quot;: type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
            stat_prefix: ingress
            codec_type: auto
            route_config:
              name: local_route
              virtual_hosts:
              - name: local_services
                domains: [&quot;*&quot;]
                routes:
                - match: { prefix: &quot;/foo/&quot; }
                  route:
                    cluster: app-service
                    prefix_rewrite: &quot;/&quot;
  
                - match: { prefix: &quot;/app/&quot; }
                  route:
                    cluster: app-service
  
  </code></pre>
  <p>A change in the Apache conf is out of scope.</p>