<p>Goal :</p>

<p>I am trying to include a thirdparty module a Http_more_headers to provide a custom name to the server in the headers.</p>

<p>I am able to <a href="https://docs.nginx.com/nginx-ingress-controller/installation/building-ingress-controller-image/" rel="nofollow noreferrer">build a custom controller image</a> with the module installed with a slightly tweaked DockerFile.</p>

<p>Issue:</p>

<p>To enable this third party module I need to add the load_module directive in the nginx.conf I am however confused on how the ingress controller interprets the nginx.conf file. If I add the load_module in the server-snippet annotation, will it work? or do I have to modify the .tmpl file to enable the third party module? or should I just modify the nginx.conf and use a COPY during the image build itself? which would be the best way to achieve the goal?</p>

Chronograph3r
<p>Use the &quot;main-snippets&quot; configMap key under &quot;data&quot; followed by the value &quot;load_module &lt;module_path&gt;&quot;</p>
<p>example:</p>
<pre><code>kind: ConfigMap
apiVersion: v1
data:
  main-snippet: load_module /usr/lib/modules/xyz_module.so
</code></pre>
<p>Check the documentation <a href="https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/configmap-resource/" rel="nofollow noreferrer">here</a>.</p>
