Skip to content
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

location is case insensitive but rewrite-target isn't #2799

Closed
bsuh opened this issue Jul 17, 2018 · 0 comments · Fixed by #2808
Closed

location is case insensitive but rewrite-target isn't #2799

bsuh opened this issue Jul 17, 2018 · 0 comments · Fixed by #2808
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@bsuh
Copy link

bsuh commented Jul 17, 2018

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/.):

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.):

"rewrite" "case" "sensitivity"


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

NGINX Ingress controller version: 0.16.2

Kubernetes version (use kubectl version): 1.10.5

Environment:

  • Cloud provider or hardware configuration: Don't know
  • OS (e.g. from /etc/os-release): Canonical Distribution of Kubernetes
  • Kernel (e.g. uname -a): Don't have access
  • Install tools:
  • Others:

What happened: Go to a path with rewrite-target annotation '/' using a different case. Path doesn't get trimmed.

What you expected to happen: Path gets trimmed.

How to reproduce it (as minimally and precisely as possible):

apiVersion: v1
kind: Service
metadata:
  name: postman-echo
spec:
  type: ExternalName
  externalName: postman-echo.com
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: rewrite-case-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
      http:
        paths:
          - backend:
              serviceName: postman-echo
              servicePort: 80
            path: /postman-echo

curl http://.../postman-echo/get works
curl http://.../Postman-echo/get returns 404

Generated nginx.conf:

                location ~* ^/postman-echo\/?(?<baseuri>.*) {
...

                        rewrite /postman-echo/(.*) /$1 break;
                        rewrite /postman-echo / break;
...

Anything else we need to know:

@aledbf aledbf added the kind/bug Categorizes issue or PR as related to a bug. label Jul 17, 2018
k8s-ci-robot added a commit that referenced this issue Aug 3, 2018
fix the bug #2799, add prefix (?i) in rewrite statement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants