</code></pre></div><p><ahref=configmap.yaml>configmap.yaml</a> defines a ConfigMap in the <code>ingress-nginx</code> namespace named <code>ingress-nginx-controller</code>. This controls the <ahref=../../../user-guide/nginx-configuration/configmap/>global configuration</a> of the ingress controller, and already exists in a standard installation. The key <code>proxy-set-headers</code> is set to cite the previously-created <code>ingress-nginx/custom-headers</code> ConfigMap.</p><divclass=highlight><pre><span></span><code><spanclass=go>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/customization/custom-headers/configmap.yaml</span>
</code></pre></div><p>The nginx ingress controller will read the <code>ingress-nginx/ingress-nginx-controller</code> ConfigMap, find the <code>proxy-set-headers</code> key, read HTTP headers from the <code>ingress-nginx/custom-headers</code> ConfigMap, and include those HTTP headers in all requests flowing from nginx to the backends.</p><h2id=test>Test<aclass=headerlinkhref=#testtitle="Permanent link"> ¶</a></h2><p>Check the contents of the ConfigMaps are present in the nginx.conf file using: <code>kubectl exec ingress-nginx-controller-873061567-4n3k2 -n ingress-nginx -- cat /etc/nginx/nginx.conf</code></p></article></div></div></main><footerclass=md-footer><divclass=md-footer-nav><navclass="md-footer-nav__inner md-grid"aria-label=Footer><ahref=../custom-errors/class="md-footer-nav__link md-footer-nav__link--prev"rel=prev><divclass="md-footer-nav__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg></div><divclass=md-footer-nav__title><divclass=md-ellipsis><spanclass=md-footer-nav__direction> Previous </span> Custom Errors </div></div></a><ahref=../external-auth-headers/class="md-footer-nav__link md-footer-nav__link--next"rel=next><divclass=md-footer-nav__title><divclass=md-ellipsis><spanclass=md-footer-nav__direction> Next </span> External authentication </div></div><divclass="md-footer-nav__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg></div></a></nav></div><divclass="md-footer-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass=md-footer-copyright> Made with <ahref=https://squidfunk.github.io/mkdocs-material/target=_blankrel=noopener> Material for MkDocs </a></div></div></div></footer></div><scriptsrc=../../../assets/javascripts/vendor.93c04032.min.js></script><scriptsrc=../../../assets/javascripts/bundle.83e5331e.min.js></script><scriptid=__langtype=application/json>{"clipboard.copy":"Copy to clipboard","clipboard.copied":"Copied to clipboard","search.config.lang":"en","search.config.pipeline":"trimmer, stopWordFilter","search.config.separator":"[\\s\\-]+","search.placeholder":"Search","search.result.placeholder":"Type to start searching","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.term.missing":"Missing"}</script><script>