Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Don't infinite-redirect when https is proxied #337

Merged
merged 1 commit into from
Mar 29, 2018

Conversation

pjeby
Copy link
Contributor

@pjeby pjeby commented Mar 27, 2018

If you're behind an ingress server that provides the https, keycloak-proxy continually redirects to itself (when using --enable-https-redirection and --enable-security-filter), because it doesn't recognize X-Forwarded-Proto: https as meaning not to redirect. Adding this line (copied from unrolled/secure's README) to the options passed to secure.New() in securityMiddleware in middleware.go fixed the problem for me:

SSLProxyHeaders:       map[string]string{"X-Forwarded-Proto": "https"},

@gambol99 gambol99 self-requested a review March 29, 2018 13:47
Copy link
Contributor

@gambol99 gambol99 left a comment

Choose a reason for hiding this comment

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

Thank you kindly @pjeby .. LGTM

@gambol99 gambol99 merged commit 6088780 into louketo:master Mar 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants