</code></pre></div><p>The <em>Service</em> object example below matches port <code>9000</code> from the <em>Pod</em> object above.</p><divclass=highlight><pre><span></span><code><spanclass=nt>apiVersion</span><spanclass=p>:</span><spanclass="l l-Scalar l-Scalar-Plain">v1</span>
</code></pre></div><p>And the <em>Ingress</em> and <em>ConfigMap</em> objects below demonstrates the supported <em>FastCGI</em> specific annotations (NGINX actually has 50 FastCGI directives, all of which have not been exposed in the ingress yet), and matches the service <code>example-service</code>, and the port named <code>fastcgi</code> from above. The <em>ConfigMap</em><strong>must</strong> be created first for the <em>Ingress Controller</em> to be able to find it when the <em>Ingress</em> object is created, otherwise you will need to restart the <em>Ingress Controller</em> pods.</p><divclass=highlight><pre><span></span><code><spanclass=c1># The ConfigMap MUST be created first for the ingress controller to be able to</span>
<spanclass=c1># find it when the Ingress object is created.</span>
</code></pre></div><h2id=fastcgi-ingress-annotations>FastCGI Ingress Annotations<aclass=headerlinkhref=#fastcgi-ingress-annotationstitle="Permanent link"> ¶</a></h2><p>To enable FastCGI, the <code>nginx.ingress.kubernetes.io/backend-protocol</code> annotation needs to be set to <code>FCGI</code>, which overrides the default <code>HTTP</code> value.</p><blockquote><p><code>nginx.ingress.kubernetes.io/backend-protocol: "FCGI"</code></p></blockquote><p><strong>This enables the <em>FastCGI</em> mode for all paths defined in the <em>Ingress</em> object</strong></p><h3id=the-nginxingresskubernetesiofastcgi-index-annotation>The <code>nginx.ingress.kubernetes.io/fastcgi-index</code> Annotation<aclass=headerlinkhref=#the-nginxingresskubernetesiofastcgi-index-annotationtitle="Permanent link"> ¶</a></h3><p>To specify an index file, the <code>fastcgi-index</code> annotation value can optionally be set. In the example below, the value is set to <code>index.php</code>. This annotation corresponds to <ahref=http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_index>the <em>NGINX</em><code>fastcgi_index</code> directive</a>.</p><blockquote><p><code>nginx.ingress.kubernetes.io/fastcgi-index: "index.php"</code></p></blockquote><h3id=the-nginxingresskubernetesiofastcgi-params-configmap-annotation>The <code>nginx.ingress.kubernetes.io/fastcgi-params-configmap</code> Annotation<aclass=headerlinkhref=#the-nginxingresskubernetesiofastcgi-params-configmap-annotationtitle="Permanent link"> ¶</a></h3><p>To specify <ahref=http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param><em>NGINX</em><code>fastcgi_param</code> directives</a>, the <code>fastcgi-params-configmap</code> annotation is used, which in turn must lead to a <em>ConfigMap</em> object containing the <em>NGINX</em><code>fastcgi_param</code> directives as key/values.</p><blockquote><p><code>nginx.ingress.kubernetes.io/fastcgi-params-configmap: "example-configmap"</code></p></blockquote><p>And the <em>ConfigMap</em> object to specify the <code>SCRIPT_FILENAME</code> and <code>HTTP_PROXY</code><em>NGINX's</em><code>fastcgi_param</code> directives will look like the following:</p><p><divclass=highlight><pre><span></span><code><spanclass=nt>apiVersion</span><spanclass=p>:</span><spanclass="l l-Scalar l-Scalar-Plain">v1</span>
</code></pre></div> Using the <em>namespace/</em> prefix is also supported, for example:</p><blockquote><p><code>nginx.ingress.kubernetes.io/fastcgi-params-configmap: "example-namespace/example-configmap"</code></p></blockquote></article></div></div></main><footerclass=md-footer><divclass=md-footer-nav><navclass="md-footer-nav__inner md-grid"aria-label=Footer><ahref=../exposing-tcp-udp-services/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> Exposing TCP and UDP services </div></div></a><ahref=../ingress-path-matching/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> Regular expressions in paths </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>