Skip to content

Instantly share code, notes, and snippets.

@mul14
Last active March 18, 2025 04:29
Show Gist options
  • Save mul14/5de5b84fbfbb574aed521006df3894a3 to your computer and use it in GitHub Desktop.
Save mul14/5de5b84fbfbb574aed521006df3894a3 to your computer and use it in GitHub Desktop.
Add more headers to Kubernetes Ingress

Ensure the allow-snippet-annotations: 'true' already set on Ingress ConfigMap. Then add this to your Ingress:

annotations:
  nginx.ingress.kubernetes.io/configuration-snippet: |
    more_set_headers "Content-Security-Policy: script-src 'self' * 'unsafe-inline' 'unsafe-eval' data: blob:; img-src 'self' * data: blob:; style-src 'self' * 'unsafe-inline' data:; font-src 'self' * data:; media-src 'self' *; connect-src 'self' *; object-src 'self' *; frame-src 'self' *;";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment