-
Notifications
You must be signed in to change notification settings - Fork 680
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
Redirect: default HTTP->HTTPS redirect does not work if envoy is deployed on non-default host ports #1300
Comments
Hey @sudeeptoroy, did you also change the ports that Envoy is configured to listen on? Here are the places you'd need to match: https://github.com/heptio/contour/blob/master/examples/ds-hostnet-split/03-contour.yaml#L36-L37 |
yes, these changes were done too.. |
this seems to be missing while programming the envoy configuration for redirect |
Ahh, I'm following now @sudeeptoroy, yes, looks like we'd need to configure that setting for this to work properly. |
@sudeeptoroy thank you for raising this issue. I believe that this should be possible to fix without having to add knowledge of the port envoy is listening on. Before we move to a fix, can I please confirm the problem, which is
Is that correct? |
For standard ports 80 and 443, no. This is correct behaviour. |
@sudeeptoroy I think the solution is to see if there is a way to prevent envoy adding any port to the redirect; ie http://foo.com -> https://foo.com shouldn't need a port. |
@davecheney envoy would not add ports until you program it that way. essentially https://github.com/envoyproxy/envoy/blob/feb56a1f8ee2cf1ea2048e20b7ba05f8199355c6/api/envoy/api/v2/route/route.proto#L954 previously I had submitted this fix #1331 |
Thank you for explaining. I played around with the rewriting options in envoy and it looks inescapable that we'll have to record the host port that traffic is nat'd into envoy on. I don't think we can commit to doing this work before Contour 1.0, as it needs to be threaded through contour's config file, the listener visitor and the route visitor. |
As part of implementing Service APIs, it's necessary to reconsider Contour's insecure to secure redirect functionality. This document suggests keeping the functionality, while allowing additional listening ports to be defined. Updates projectcontour#1300 Updates projectcontour#2922 Updates projectcontour#3086 Signed-off-by: Nick Young <ynick@vmware.com>
The Contour project currently lacks enough contributors to adequately respond to all Issues. This bot triages Issues according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
The Contour project currently lacks enough contributors to adequately respond to all Issues. This bot triages Issues according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
http redirect url is not composed correctly when envoy is deployed on non standard hostport (!80, !443).
Deployment steps:
- containerPort: 80
hostPort: 8000
name: http
protocol: TCP
- containerPort: 443
hostPort: 6443
name: https
protocol: TCP
developer's steps:
Example: curl -L http://redirect-example.com:8000
Issue:
Redirect 301 is received with a wrong redirect port.
example
Received redirect url: https://redirect-example.com:8000
Expected url: https://redirect-example.com:6443
Environment:
The text was updated successfully, but these errors were encountered: