Skip to content

proxy-redirect is ignored #12917

@gfrankliu

Description

@gfrankliu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportCategorizes issue or PR as a support question.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions