Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Add X-Forwarded-Proto header when proxying https traffic #171

Open
deltaroe opened this issue Nov 18, 2015 · 4 comments · Fixed by joejulian/oauth2_proxy#10 · May be fixed by #177
Open

Add X-Forwarded-Proto header when proxying https traffic #171

deltaroe opened this issue Nov 18, 2015 · 4 comments · Fixed by joejulian/oauth2_proxy#10 · May be fixed by #177

Comments

@deltaroe
Copy link

Some upstream systems (Jenkins under Jetty for example) need the X-Forwarded-Proto header present to properly function when using oauth2_proxy as both auth and ssl termination.

Without the header any redirects returned by the upstream are for http instead of https

@jehiah
Copy link
Member

jehiah commented Nov 18, 2015

@deltaroe sounds good. Do you want to open a PR for this?

@deltaroe
Copy link
Author

I wrote a dirty hardcoded hack that fixed my current issue, but I have very limited experience with go and figured I'd create an issue incase someone had cycles to do it properly before I had the time to stumble through doing it myself.

artyom pushed a commit to artyom/oauth2_proxy that referenced this issue Dec 2, 2015
Guess protocol from redirect-url scheme if present, or from
cookie-secure flag value.

closes bitly#171
@artyom artyom linked a pull request Dec 2, 2015 that will close this issue
@r0ps3c
Copy link

r0ps3c commented May 2, 2016

We're encountering this issue also, and in the course of investigating I had a question: would we not want X-Forwarded-Proto to always be present, and set to HTTPS? In almost all real-world cases I can imagine, either the ssl terminator in front of oath2_proxy (haproxy, nginx, etc.) would set it (and oauth2_proxy could just pass it along), or oauth2_proxy would set it correctly. If necessary we could have a flag that disables this, for the odd situation where someone wants to run a service that exposes an HTTP endpoint externally (but still protected by oauth over SSL).

This would remove the need to try to detect via cookies, upstream scheme, etc.

chen-anders pushed a commit to wistia/oauth2_proxy that referenced this issue Jan 30, 2017
Guess protocol from redirect-url scheme if present, or from
cookie-secure flag value.

closes bitly#171
@cakeface
Copy link

Huh, I just hit this issue trying to run Jenkins as well. I like the wistia change to detect via either the redirect URL or the cookie secure parameter whether we are http or https and always add the header.

joejulian pushed a commit to joejulian/oauth2_proxy that referenced this issue Mar 2, 2018
Guess protocol from redirect-url scheme if present, or from
cookie-secure flag value.

closes bitly#171
joejulian pushed a commit to joejulian/oauth2_proxy that referenced this issue Mar 3, 2018
Guess protocol from redirect-url scheme if present, or from
cookie-secure flag value.

closes bitly#171
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants