<p>I have deployed an nginx ingress controller in my eks cluster. I want to add more security to my nginx deployment i.e add <a href="https://content-security-policy.com/examples/nginx/" rel="nofollow noreferrer">content-security-policy</a> header and the below</p>
<pre><code>X-Frame-Options: 
Content-Security-Policy:
X-Content-Type-Options: 
X-XSS-Protection: 
</code></pre>
<p>Is there any document i can follow to do it. please help.</p>
<p>I added in the configmap and turns out it didn't help as well.</p>
<p>Thanks</p>

<p>you can try this</p>
<pre><code>ingress:
  enabled: true
  annotations:
     kubernetes.io/ingress.class: nginx
     nginx.ingress.kubernetes.io/configuration-snippet: |
        more_set_headers &quot;X-Frame-Options: Deny&quot;;
        more_set_headers &quot;X-Xss-Protection: 1; mode=block&quot;;
        more_set_headers &quot;X-Content-Type-Options: nosniff&quot;;
        more_clear_headers &quot;Cache-Control&quot;;
        more_set_headers &quot;Cache-Control: must-revalidate&quot;;  
        proxy_set_header l5d-dst-override 

</code></pre>
<p>Here is the list of all <a href="https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md" rel="nofollow noreferrer">nginx-configuration-annotations</a></p>
<p>This fixes my issue and verifies it using <a href="https://www.zaproxy.org/" rel="nofollow noreferrer">zaproxy</a></p>
