ingress-nginx
ingress-nginx copied to clipboard
proxy-redirect is ignored
What happened:
I upgraded from ingress-nginx 1.8.0 to 1.12.0, and now the ingress annonation for proxy-redirect is ignored:
sample config:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-ingress
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /$4
nginx.ingress.kubernetes.io/proxy-redirect-from: /
nginx.ingress.kubernetes.io/proxy-redirect-to: /$1/$2/$3/
spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /(prod)/([-a-z0-9]+)/(webrtc)/?(.*)
pathType: ImplementationSpecific
backend:
service:
name: streaming
port:
number: 8889
What you expected to happen:
The response "Location" header should have the proper uri prefix matching the request.
I checked the generated nginx.conf from the old ingress 1.8.0 and find:
proxy_redirect / /$1/$2/$3/;
But the nginx.conf from the new ingress 1.12.0 has:
proxy_redirect off;
It seems the new ingress ignored the annotation in the ingress config.