-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Forcing Scheme and Port to Match #3361
Comments
Configuration for the reverse proxy transport is inferred from the upstream address; if it's a "plain" network address (e.g. socket) we use it literally; if it's a URL, we can draw from the different components like scheme and port, so that if you specify But it's problematic if you specify a scheme that says "use TLS" with a port that says "don't use TLS." Why do you want to run HTTPS on port 80? AFAIK I that defies IANA conventions and expected behavior pretty much everywhere. We want networks to be compatible.... You can do this, of course, but not with implicit means, since the conflict leaves it ambiguous. (Hopefully that answers your question! I will close the issue but feel free to continue discussion.) |
@mholt Thanks for that! Unfortunately I'm proxying an application that performs SSL on port 80. For now, I'm going to do a custom build of Caddy. Would you and the team consider an option to force an overwrite, if I were to write a patch and submit it? |
You can already do this, just don't leave it up to implicit behavior:
At least, I think that'll work. (It's just weird.) |
Caddy spits out a parsing error.
|
An upstream like https://localhost:80 is still forbidden, but an addr of localhost:80 can be used while explicitly enabling TLS as an override; we just don't allow the implicit behavior to be ambiguous.
Hmm, I see... I've pushed a fix to master in 1c17e6c @vtky - can you please try it and confirm? Basically, if a scheme is given explicitly, it must not conflict with port convention, but if the scheme is omitted, i.e. what I showed above, it should work, since there's nothing implicit/hidden going on there. |
Not sure what went wrong but it still failed. I had to comment out
Then it works for me. |
@vtky are you sure you tried the version from that commit? It worked for me. You need to use the syntax I provided above. |
Hello!
I'd like to find out the rationale for the following code
caddy/modules/caddyhttp/reverseproxy/caddyfile.go
Line 121 in afecd90
It forces http to match port 80 and https to match 443 and there is no way to overwrite if I want to run https on port 80. (unless I'm missing something?)
The text was updated successfully, but these errors were encountered: