-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The nginx.ingress.kubernetes.io/server-snippet annotation functionality is not working properly. #12625
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/remove-kind bug The information you have provided does not show any problem. The request you sent, the config of the controller, the config of the ingress, the logs of the controller, the result of the curl request with -i and -v, are some of the example of information that helps a reader get some idea of what problem has to be solved. |
I might have a similar issue, the following snippet is not allowed since 4.12.0
ingress-nginx is deployed through the chart and validations have been set to false:
resulting in the following pod arguments:
Most of our ingresses broke since 4.12 due to this snippet (resulting in the following error):
Should I dig deeper or is this a known issue @longwuyuan ? |
Can you play with the risk settings |
Snippet annotations have annotation risk level |
echo "
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: snippet.example.com
namespace: default
annotations:
nginx.ingress.kubernetes.io/server-snippet: |
set $agentflag 0;
if ($http_user_agent ~* "(Android|IPhone)") {
set $agentflag 1;
}
if ($agentflag = 1) {
return 302 http://www.baidu.com;
}
spec:
rules:
- host: snippet.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: snippet
port:
number: 80
" | kubectl apply -f -
The text was updated successfully, but these errors were encountered: