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

When running behind another proxy, need to tell traefik to trust its X-Forwarded-* headers #13

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

dsagal
Copy link
Member

@dsagal dsagal commented Jan 10, 2024

This addresses the issues described in #12.

When SSL is terminated externally, grist-omnibus receives requests via HTTP. In order for it to know that the end-user accessed it via HTTPS, the external reverse proxy should set X-Forwarded-* headers (only X-Forwarded-Proto matters here), and traefik in grist-omnibus needs to know to trust it.

The most secure way is to specify the IP address or range of the proxy, so that's the new environment variable being exposed.

In addition, traefik-forward-auth needs its own flag to trust the X-Forwarded-* headers, as it is the piece that constructs redirect_uri based on whether it thinks the end-user is using HTTP or HTTPS.

Copy link
Member

@paulfitz paulfitz left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks for looking into this @dsagal. Tiny typo.

README.md Outdated
@@ -100,6 +100,12 @@ docker run \
Remember if you are on a public server you don't need to do this, you can
set `HTTPS=auto` and have Traefik + Let's Encrypt do the work for you.

If you run the omnibus behind a separate reverse proxy that terminates SSL, then you should
`HTTPS=external`, and set an additional environment variable `TRUSTED_PROXY_IPS` to the IIP
Copy link
Member

Choose a reason for hiding this comment

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

*IP ?

@dsagal dsagal merged commit 9a5e97c into main Jan 10, 2024
@dsagal dsagal deleted the proxy-https-fix branch January 10, 2024 23:15
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.

2 participants