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

Correct App-Root kubernetes behavior #3592

Merged
merged 4 commits into from
Jul 12, 2018
Merged

Conversation

dtomcej
Copy link
Contributor

@dtomcej dtomcej commented Jul 10, 2018

What does this PR do?

Corrects App-Root kubernetes Behavior

Motivation

Fixes #3589

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

We will need to update documentation to reflect being unable to mix regex with app-root.

The ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: whoami
  annotations:
     traefik.ingress.kubernetes.io/app-root: /app1/index.html
spec:
  rules:
  - host: localhost
    http:
      paths:
      - path: /
        backend:
          serviceName: whoami
          servicePort: http

Now results in:

$ curl -v localhost
* Rebuilt URL to: localhost/
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 80 (#0)
> GET / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< Location: http://localhost/app1/index.html
< Date: Tue, 10 Jul 2018 19:31:55 GMT
< Content-Length: 5
< Content-Type: text/plain; charset=utf-8
< 
* Connection #0 to host localhost left intact

@dtomcej
Copy link
Contributor Author

dtomcej commented Jul 10, 2018

Should also note that the traefik.ingress.kubernetes.io/redirect-permanent annotation can also determine if a 301 or a 302 should be sent.

@ldez ldez added this to the 1.7 milestone Jul 10, 2018
Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dtomcej
Copy link
Contributor Author

dtomcej commented Jul 11, 2018

Documentation added. Ready for review + merge

@nmengin nmengin removed the area/acme label Jul 12, 2018
Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants