-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
v2 - add forward-related headers by default #3275
Comments
Can you be more specific what is needed? What are the headers that the backend is getting, and what are the headers it requires? By default, all the incoming headers are simply forwarded to the backend (but X-Forwarded-For is added implicitly already). |
@mholt, thanks for checking that! I couldn't debug it yet, but based on the other reverse proxies that I use successfully, and also the fact that the only part that is wrong is the protocol, I'm pretty sure the one that is missing is the X-Forwarded-Proto. |
Sorry for the double post, but I believe that when the --from has https and --to has http protocols, X-Forwarded-Proto could be included by default. |
We could do that. That seems like a good idea, but I'd probably just have it be set regardless of To/From protocols. I'll commit that in a moment. Edit: Actually can you please confirm that is the missing header first? You can use a Caddyfile to set the header, I think your total Caddyfile would be like 3 lines:
and see what happens. |
@mholt I can confirm here, the above config works for my upstream server!
Makes sense... I can't think of any side-effects, besides sending a (non-standard?) headers when not needed. As a side note, I'm a complete newbie with Caddy, so I first tried Again, great work with Caddy! I never thought I could find a reverse proxy with SSL support that would be so easy to run! |
See the CLI docs here: https://caddyserver.com/docs/command-line#caddy-run You need to specify |
Makes sense! Thanks for explaining that. My weird command didn't fail, though, that's what happened:
The server appeared to have started normally, but my configuration was ignored (as expected, but I couldn't understand that by the output). Let me know if that was unexpected and you want me to raise an issue for that. |
@brunojcm I've pushed a potential enhancement to #3276. Could you please give it a try? I think this can and should go into 2.0 if you can try it today that would be great :) |
Regarding the config file:
I guess that second argument is just being ignored. It's supposed to be |
Done, results posted on the PR.
I'd say that might trick some stupid people that don't read the docs carrefully (like me) trying to use custom config files. I'd tend to say that if the parameter is not expected, the command should be rejected. Sorry, I'm going way off-topic here, this is just minor feedback. I'm just even daring to say it because you guys seems to strive to make the experience as simple and pleasant as possible, without having to read much docs, so that might be a way to improve it :D |
Yeah, we'll work on that. Thanks! |
I just found out Caddy, firstly I'd like to say it looks amazing, new
reverse-proxy
mode seems so handy, even certificates are automatically generated S2I just missed one thing; I'm running this command:
And my upstream server expects some headers to know the request is actually being received through a proxy. It ends up generating a URL to redirect, and it uses
http://public.host
, instead ofhttps://public.host
, which breaks my app.Any chances of getting this working?
The text was updated successfully, but these errors were encountered: