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

caddyhttp: support X-Forwarded-Host #3599

Closed
kennethklee opened this issue Jul 25, 2020 · 2 comments
Closed

caddyhttp: support X-Forwarded-Host #3599

kennethklee opened this issue Jul 25, 2020 · 2 comments

Comments

@kennethklee
Copy link

Noticed X-Forwarded-Host isn't used to match the Host.

I've got a caddy server behind a gateway that terminates SSL and forwards the Host header via the X-Forwarded-Host header.

The workaround I'm using looks like this:

@app {
  Header X-Forwarded-For app.example.com
}
reverse_proxy @app node1:80

Would be nice to just use app.example.com as an address.

@kennethklee kennethklee changed the title Support X-Forwarded-Host caddyhttp: support X-Forwarded-Host Jul 28, 2020
@mholt
Copy link
Member

mholt commented Jul 31, 2020

Thanks for the feature request. I've just commented on the PR, where I guess the discussion will move to. In summary, I'm not convinced this is a good idea, just to save 1 line of config, especially in a way that is irreversable.

@kennethklee
Copy link
Author

Closing this as per PR discussion.

Also noticed this is related #3262 since it's dealing with Forwarded headers.

Not sure if it's a good idea, but might I suggest opening an issue to create a guide on how to support forwarded headers like nginx -- https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/

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

No branches or pull requests

2 participants