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

reverseproxy: Set X-Forwarded-Proto #3276

Merged
merged 1 commit into from
Apr 17, 2020
Merged

reverseproxy: Set X-Forwarded-Proto #3276

merged 1 commit into from
Apr 17, 2020

Conversation

mholt
Copy link
Member

@mholt mholt commented Apr 17, 2020

This sets the X-Forwarded-Proto header to upstreams by default; seems like a good idea for wider compatibility by default; overrideable if necessary.

@brunojcm can you please give this a try? Either build from this branch or download the CI artifacts when it completes.

Closes #3275.

@mholt mholt added this to the v2.0.0 milestone Apr 17, 2020
@mholt mholt requested a review from francislavoie April 17, 2020 15:09
@mholt mholt changed the title reverseproxy: Set X-Forwarded-Proto (closes #3275) reverseproxy: Set X-Forwarded-Proto Apr 17, 2020
@bcmedeiros
Copy link

bcmedeiros commented Apr 17, 2020

@mholt Fix is perfect!

✔ ~/git/caddy/cmd/caddy [forwarded-proto|✔]
23:24 $ ./caddy reverse-proxy --from https://public.host --to http://localhost:8081

Everything works like a charm, upstream builds redirects perfectly.

Copy link
Member

@francislavoie francislavoie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only concern I'd have is there being an escape hatch if people don't want it passed to the backend, but setting header_up -X-Forwarded-Proto should do the trick, so 👍

@mholt
Copy link
Member Author

mholt commented Apr 17, 2020

Yep, it's the same as X-Forwarded-For in that regard.

Thanks, both!

@mholt mholt merged commit 76bbb47 into master Apr 17, 2020
@mholt mholt deleted the forwarded-proto branch April 17, 2020 15:53
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

Successfully merging this pull request may close these issues.

v2 - add forward-related headers by default
3 participants