I'm trying to add an extra forwarded header in my Ingress resource using this annotation:
```
annotations:
"kubernetes.io/ingress.class": "nginx-default"
"nginx.ingress.kubernetes.io/configuration-snippet": |
add_header X-Forwarded-Proto https;
```
However, I'm getting this error message:
'admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: nginx.ingress.kubernetes.io/configuration-snippet annotation cannot be used. Snippet directives are disabled by the Ingress administrator.' What should I do?
4 Answers
This could be an XY problem. Can you explain why you need the `X-Forwarded-Proto` header specifically? What are you trying to achieve?
You should check your configuration settings. The snippet directives are disabled by default, so you'll need to enable them to use the snippet annotation for your Ingress.
It looks like you might need to provide more details about your setup. Are you running on-prem or in the cloud? And which provider are you using? Also, are you the Ingress admin, or do you have someone else managing it? It's important to consider whether you're willing to lower your security by allowing snippets or if there's a better configuration alternative.
Just a heads-up, they're disabled for a reason! You might want to look into the security implications before turning them back on. If you're the cluster admin, you’ll need to evaluate what that means for your overall security. Otherwise, reach out to the person who manages the Ingress settings.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures