<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Headers on</title><link>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/</link><description>Recent content in Headers on</description><generator>Hugo</generator><language>en</language><atom:link href="https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/index.xml" rel="self" type="application/rss+xml"/><item><title>Header-based routing</title><link>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/headers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/headers/</guid><description>&lt;p>Emissary can route to target services based on HTTP headers with the &lt;code>headers&lt;/code> and &lt;code>regex_headers&lt;/code> specifications. Multiple mappings with different annotations can be applied to construct more complex routing rules.&lt;/p>
&lt;h2 id="the-headers-annotation">The &lt;code>headers&lt;/code> annotation&lt;/h2>
&lt;p>The &lt;code>headers&lt;/code> attribute is a dictionary of &lt;code>header&lt;/code>: &lt;code>value&lt;/code> pairs. Emissary will only allow requests that match the specified &lt;code>header&lt;/code>: &lt;code>value&lt;/code> pairs to reach the target service.&lt;/p>
&lt;h3 id="example">Example&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">---&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">apiVersion&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">getambassador.io/v3alpha1&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">kind&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">Mapping&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">metadata&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">name&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">quote-backend&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">spec&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">prefix&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">/backend/&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">service&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">quote&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">headers&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">x-quote-mode&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">backend&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">x-random-header&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">datawire&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>will allow requests to /backend/ to succeed only if the x-quote-mode header has the value backend and the x-random-header has the value &lt;code>datawire&lt;/code>.&lt;/p></description></item><item><title>Add request headers</title><link>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/add-request-headers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/add-request-headers/</guid><description>&lt;p>Emissary can add a dictionary of HTTP headers that can be added to each request that is passed to a service.&lt;/p>
&lt;h2 id="the-add_request_headers-attribute">The &lt;code>add_request_headers&lt;/code> attribute&lt;/h2>
&lt;p>The &lt;code>add_request_headers&lt;/code> attribute is a dictionary of &lt;code>header&lt;/code>: &lt;code>value&lt;/code> pairs. The &lt;code>value&lt;/code> can be a &lt;code>string&lt;/code>, &lt;code>bool&lt;/code> or &lt;code>object&lt;/code>. When it is an &lt;code>object&lt;/code>, the object should have a &lt;code>value&lt;/code> property, which is the actual header value, and the remaining attributes are additional envoy properties.&lt;/p>
&lt;p>Envoy dynamic values &lt;code>%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%&lt;/code> and &lt;code>%PROTOCOL%&lt;/code> are supported, in addition to static values.&lt;/p></description></item><item><title>Add response headers</title><link>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/add-response-headers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/add-response-headers/</guid><description>&lt;p>Emissary can add a dictionary of HTTP headers that can be added to each response that is returned to the client.&lt;/p>
&lt;h2 id="the-add_response_headers-attribute">The &lt;code>add_response_headers&lt;/code> attribute&lt;/h2>
&lt;p>The &lt;code>add_response_headers&lt;/code> attribute is a dictionary of &lt;code>header&lt;/code>: &lt;code>value&lt;/code> pairs. The &lt;code>value&lt;/code> can be a &lt;code>string&lt;/code>, &lt;code>bool&lt;/code> or &lt;code>object&lt;/code>. When it is an &lt;code>object&lt;/code>, the object should have a &lt;code>value&lt;/code> property, which is the actual header value, and the remaining attributes are additional envoy properties.&lt;/p>
&lt;p>Envoy dynamic values &lt;code>%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%&lt;/code> and &lt;code>%PROTOCOL%&lt;/code> are supported, in addition to static values.&lt;/p></description></item><item><title>Remove request headers</title><link>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/remove-request-headers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/remove-request-headers/</guid><description>&lt;p>Emissary can remove a list of HTTP headers that would be sent to the upstream from the request.&lt;/p>
&lt;h2 id="the-remove_request_headers-attribute">The &lt;code>remove_request_headers&lt;/code> attribute&lt;/h2>
&lt;p>The &lt;code>remove_request_headers&lt;/code> attribute takes a list of keys used to match to the header.&lt;/p>
&lt;p>&lt;code>remove_request_headers&lt;/code> can be set either in a &lt;code>Mapping&lt;/code> or using &lt;a href="../../defaults">&lt;code>ambassador Module defaults&lt;/code>&lt;/a>.&lt;/p>
&lt;h2 id="mapping-example">Mapping example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">---&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">apiVersion&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">getambassador.io/v3alpha1&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">kind&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">Mapping&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">metadata&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">name&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">quote-backend&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">spec&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">prefix&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">/backend/&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">remove_request_headers&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#000">authorization&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">service&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">quote&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>will drop the header with key &lt;code>authorization&lt;/code>.&lt;/p></description></item><item><title>Remove response headers</title><link>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/remove-response-headers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/remove-response-headers/</guid><description>&lt;p>Emissary can remove a list of HTTP headers that would be sent to the client in the response (e.g. default &lt;code>x-envoy-upstream-service-time&lt;/code>).&lt;/p>
&lt;h2 id="the-remove_response_headers-attribute">The &lt;code>remove_response_headers&lt;/code> attribute&lt;/h2>
&lt;p>The &lt;code>remove_response_headers&lt;/code> attribute takes a list of keys used to match to the header.&lt;/p>
&lt;p>&lt;code>remove_request_headers&lt;/code> can be set either in a &lt;code>Mapping&lt;/code> or using &lt;a href="../../defaults">&lt;code>ambassador Module defaults&lt;/code>&lt;/a>.&lt;/p>
&lt;h2 id="mapping-example">Mapping example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">---&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">apiVersion&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">getambassador.io/v3alpha1&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">kind&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">Mapping&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">metadata&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">name&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">quote-backend&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline">&lt;/span>&lt;span style="color:#204a87;font-weight:bold">spec&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">prefix&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">/backend/&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">remove_response_headers&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>- &lt;span style="color:#000">x-envoy-upstream-service-time&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#204a87;font-weight:bold">service&lt;/span>&lt;span style="color:#000;font-weight:bold">:&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline"> &lt;/span>&lt;span style="color:#000">quote&lt;/span>&lt;span style="color:#f8f8f8;text-decoration:underline">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>will drop the header with key &lt;code>x-envoy-upstream-service-time&lt;/code>.&lt;/p></description></item><item><title>Host headers</title><link>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/host/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://emissary-ingress.website.cncfstack.com/docs/4.1/topics/using/headers/host/</guid><description>&lt;p>Emissary supports several different methods for managing the HTTP &lt;code>Host&lt;/code> header.&lt;/p>
&lt;h2 id="using-host-and-host_regex">Using &lt;code>host&lt;/code> and &lt;code>host_regex&lt;/code>&lt;/h2>
&lt;p>A mapping that specifies the &lt;code>host&lt;/code> attribute will take effect &lt;em>only&lt;/em> if the HTTP &lt;code>Host&lt;/code> header matches the value in the &lt;code>host&lt;/code> attribute. If &lt;code>host_regex&lt;/code> is &lt;code>true&lt;/code>, the &lt;code>host&lt;/code> value is taken to be a regular expression. Otherwise, an exact string match is required.&lt;/p>
&lt;p>You may have multiple mappings listing the same resource but different &lt;code>host&lt;/code> attributes to effect &lt;code>Host&lt;/code>-based routing. An example:&lt;/p></description></item></channel></rss>