Envoy routing and rewriting snippet

It is possible to rewrite URLs with Envoy for the backend. Please note that the HTML output needs to have the proper routes! (That is why I am not going to investigate further in this direction).

REF: https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route.proto#route-route 

Also note that the string is going to be rendered literally for direct_response –> body –> inline_string, even if you include HTML tags into it. Probably a header is set that this is to be interpreted as text by the browser.

      filters:
      - name: envoy.http_connection_manager
        config:
          stat_prefix: ingress_https
          route_config:
            virtual_hosts:
            - name: backend
              domains: ["*"]
              routes:
              - match: { prefix: "/taxgod/" }
                route: { cluster: target_taxgod, prefix_rewrite: "/"}
              - match: { prefix: "/taxgod" }
                route: { cluster: target_taxgod, prefix_rewrite: "/"}
              - match: { prefix: "/picockpit/" }
                route: { cluster: target_picockpit, prefix_rewrite: "/" }
              - match: { prefix: "/picockpit" }
                route: { cluster: target_picockpit, prefix_rewrite: "/" }
              - match: { prefix: "/gagarin" }
                direct_response: { status: 200, body: { inline_string: "Bringing redemption to my dark night. Beautiful surrender is where I wanna be." } }
              - match: { prefix: "/" }
                direct_response: { status: 200, body: { inline_string: " a href="/taxgod" Taxgod /a  - a href="/picockpit" PiCockpit /a " } }
          http_filters:
          - name: envoy.router
            config: {}