-
Notifications
You must be signed in to change notification settings - Fork 689
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
add support from upgrading http->https in location header #3657
Comments
So, the requirement here is "Rewrite all Location headers to HTTPS, always"? And you are currently doing this globally for Contour? I can see adding a boolean thing somewhere that could replicate this, which dodges the support and related issues from #3006. Sounds like a config file option like |
Just checking out Contour and stumbled over this issue, does this mean that Contour has no simple toggle or something like a built-in middleware to upgrade http reuqests to https? Didn't find anything in the docs but skimmed them briefly only... |
@youngnick that should work well. @205g0 [edit; for this particular situation] not yet, no. You can use a lua filter with the above code to handle upgrading http->https for now. |
@205g0 at a high level, Contour does support an automatic 301 redirect from http->https if you're using HTTPProxy for ingress resources. The issue that @andrewzah is referencing is a little different from basic redirects. |
@stevesloka thx for the info. Ok I am confused now haha, someone who likes standard Ingress with terse annotations and will upgrade to Gateway API in future, should I really setup a new cluster which will run for some time on HTTPProxy?? I know it will be supported beyond Gateway's GA but yeah... |
@stevesloka I checked the API spec for HTTPProxy at https://projectcontour.io/docs/main/config/api/ and couldn't find anything about to-https-redirects in that CRD, even if I go down the rabbit hole into the sub-APIs there's even anything about simple redirects. Hope I just missed it or the HTTPProxy CRD isn't capable of doing redirects neither?! 😶 |
@205g0 HTTPProxy doesn't have a way to ask for redirect to HTTPS, because it's on by default, unless you specifically disable it by creating an insecure proxy that matches the same domain name and route. If you just ask for @andrewzah's case is about changing the Also, HTTPProxy will be supported until two requirements are fulfilled, at least:
I don't see either of those things happening for a long time. |
@youngnick thanks for the quick clarifications. Having a HTTP->HTTPS redirect turned on by default is a great design decision. I assume, this default redirect also keeps the path?! So if someone typed Apologies for such nitty-gritty questions, hope I can just try it out myself soon, have been playing around with the Ingress only. |
@205g0, yes that's correct. All paths for |
Just wanted to reiterate Nick’s answer on whether it’s worth investing in HTTPProxy before Gateway API is ready. Yes, absolutely it is. Some other reasons I can think of would be
@youngnick what's your take on landing this request? |
I understand the request is to have a way to say "All HTTP requests should be forwarded to the equivalent HTTPS request, always". Rather than doing this with Lua, I think it would be better to have a way to mandate the behavior we already have with HTTPProxy, which does this for you by default. So, we have a boolean in the config file that would make all methods (Ingress, HTTPProxy, Gateway maybe?) work like this:
The main thing here is to make a way to mandate that this is the only acceptable behavior, I think, rather than the specific Lua implementation. Is that correct @andrewzah ? |
This is correct. Something like a boolean value would work for this specific scenario. |
@xaleeks @youngnick However, a more robust solution would be to allow regex editing of header values in general. Right now there are |
I actually think it would be better to create a more generic solution to this. I think what we need is a way to do extend the |
I agree that the @andrewzah, are you looking to have this because you want to:
If it's the former, then we're talking about some sort of config setting that says "I seriously don't want anyone to be able to do HTTP, at all, and they should get 301 redirects without the option of changing them". If it's the latter, then something like #2776 would be a better solution, agreed. @ccravens, I'm going to do a quick update on #2776 as well, some stuff has changed since we last touched that one. |
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 |
Creating this per our discussion in the last contour community meeting on 5/4.
Right now we're accomplishing this with the following filter + lua code:
and the lua code extracted:
See the first use case mentioned in this issue: #3006
The text was updated successfully, but these errors were encountered: