You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):
CORS
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
What happened:
When enabling CORS headers, they are only added with status 200 responses, not 4xx or 5xx
What you expected to happen:
Headers should be added no matter what the status code is
How to reproduce it (as minimally and precisely as possible):
create an nginx controller with version 0.9-beta.16
create an ingress with the following annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/enable-cors: "true"
ingress.kubernetes.io/cors-allow-headers: "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization"
send a request to a backend that will answer with 500 status
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):
NO
What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):
CORS
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
NGINX Ingress controller version:
0.9-beta.16
Kubernetes version (use
kubectl version
):Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.2", GitCommit:"bdaeafa71f6c7c04636251031f93464384d54963", GitTreeState:"clean", BuildDate:"2017-10-24T19:48:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.8-gke.0", GitCommit:"a7061d4b09b53ab4099e3b5ca3e80fb172e1b018", GitTreeState:"clean", BuildDate:"2017-10-10T18:48:45Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Environment:
uname -a
):What happened:
When enabling CORS headers, they are only added with status 200 responses, not 4xx or 5xx
What you expected to happen:
Headers should be added no matter what the status code is
How to reproduce it (as minimally and precisely as possible):
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/enable-cors: "true"
ingress.kubernetes.io/cors-allow-headers: "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization"
Anything else we need to know:
SO issue with some info: https://stackoverflow.com/questions/20414669/nginx-add-headers-when-returning-400-codes
it seems that the nginx version used in the project supports adding "always" as a third parameter to add_header, this might fix the issue
The text was updated successfully, but these errors were encountered: