{"id":7015,"date":"2019-01-17T22:17:45","date_gmt":"2019-01-17T21:17:45","guid":{"rendered":"https:\/\/pi3g.com\/?p=7015"},"modified":"2019-01-17T22:17:45","modified_gmt":"2019-01-17T21:17:45","slug":"envoy-routing-and-rewriting-snippet","status":"publish","type":"post","link":"https:\/\/pi3g.com\/de\/envoy-routing-and-rewriting-snippet\/","title":{"rendered":"Envoy-Routing und Rewriting-Snippet"},"content":{"rendered":"<p><\/p>\n<p>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).<\/p>\n<p>REF: <a href=\"https:\/\/www.envoyproxy.io\/docs\/envoy\/latest\/api-v2\/api\/v2\/route\/route.proto#route-route\">https:\/\/www.envoyproxy.io\/docs\/envoy\/latest\/api-v2\/api\/v2\/route\/route.proto#route-route<\/a>&nbsp;<\/p>\n<p>Also note that the string is going to be rendered literally for direct_response \u2013&gt; body \u2013&gt; 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. <\/p>\n<p><\/p>\n<pre>      filters:\n      - name: envoy.http_connection_manager\n        config:\n          stat_prefix: ingress_https\n          route_config:\n            virtual_hosts:\n            - name: backend\n              domains: [\"*\"]\n              routes:\n              - match: { prefix: \"\/taxgod\/\" }\n                route: { cluster: target_taxgod, prefix_rewrite: \"\/\"}\n              - match: { prefix: \"\/taxgod\" }\n                route: { cluster: target_taxgod, prefix_rewrite: \"\/\"}\n              - match: { prefix: \"\/picockpit\/\" }\n                route: { cluster: target_picockpit, prefix_rewrite: \"\/\" }\n              - match: { prefix: \"\/picockpit\" }\n                route: { cluster: target_picockpit, prefix_rewrite: \"\/\" }\n              - match: { prefix: \"\/gagarin\" }\n                direct_response: { status: 200, body: { inline_string: \"Bringing redemption to my dark night. Beautiful surrender is where I wanna be.\" } }\n              - match: { prefix: \"\/\" }\n                direct_response: { status: 200, body: { inline_string: \" a href=\"\/taxgod\" Taxgod \/a  - a href=\"\/picockpit\" PiCockpit \/a \" } }\n          http_filters:\n          - name: envoy.router\n            config: {}\n<\/pre>\n<pre><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Es ist m\u00f6glich, URLs mit Envoy f\u00fcr das Backend umzuschreiben. Bitte beachten Sie, dass die HTML-Ausgabe die richtigen Routen haben muss! (Deshalb werde ich nicht weiter in diese Richtung forschen). REF: https:\/\/www.envoyproxy.io\/docs\/envoy\/latest\/api-v2\/api\/v2\/route\/route.proto#route-route Beachten Sie auch, dass der String f\u00fcr direct_response -&gt; body -&gt; inline_string,... w\u00f6rtlich wiedergegeben wird.<\/p>","protected":false},"author":830,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[402],"tags":[481,486],"class_list":["post-7015","post","type-post","status-publish","format-standard","hentry","category-development","tag-envoy","tag-rewriting-urls"],"_links":{"self":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/7015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/users\/830"}],"replies":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/comments?post=7015"}],"version-history":[{"count":1,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/7015\/revisions"}],"predecessor-version":[{"id":7016,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/7015\/revisions\/7016"}],"wp:attachment":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/media?parent=7015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/categories?post=7015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/tags?post=7015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}