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

Support non-root prefixed reverse proxy environments #45

Merged
merged 3 commits into from
Sep 4, 2023

Conversation

NixM0nk3y
Copy link
Contributor

We'd like to use caddy-security in an reverse-proxy environment where caddy is routed from a fixed-prefix i.e.

myapp.mydomain.com/app1/oauth2/github -> ( reverse proxy ) -> app1backend.mydomain.com/oauth2/github

We encountered issues where the redirect_url was being set to app1backend.mydomain.com which was corrected by setting X-Forwarded-Host. This still left the issue where the app1 prefix was being dropped in the redirect_url.

A number of standard reverse proxies use the X-Forwarded-Prefix to forward any prefix mapping onto backend applications.

This PR looks the add X-Forwarded-Prefix support to allow caddy-security to work in prefixed reverse proxies environments.

@greenpau greenpau merged commit 5b7a408 into greenpau:main Sep 4, 2023
2 checks passed
@greenpau
Copy link
Owner

greenpau commented Sep 4, 2023

@NixM0nk3y , thank you for contributing!

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