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

Add support for X-Forwarded-Proto header #17

Open
daften opened this issue Aug 25, 2021 · 3 comments
Open

Add support for X-Forwarded-Proto header #17

daften opened this issue Aug 25, 2021 · 3 comments

Comments

@daften
Copy link

daften commented Aug 25, 2021

By default nginx doesn't use the X-Forwarded-Proto header to set the HTTPS entry in the S_SERVER global array. By updating the default nginx file, that could be remedied. For apache SetEnvIf can be used in a htaccess file, for nginx, no idea what the best approach is tbh.

@daften
Copy link
Author

daften commented Aug 25, 2021

I get that error from Forceu/barcodebuddy-android#4, because the redirect isn't followed in the app it seems. But if the URL generated from the BCB UI would be correct, it would be fine too :)

@Forceu
Copy link
Owner

Forceu commented Aug 28, 2021

Is this related to the Docker nginx configuration or the Barcode Buddy example file? Because it is already set in
https://github.com/Forceu/barcodebuddy/blob/2ca740956d3072baa2bc1767caf61e32285a4fd0/example/nginxReverseProxy.conf#L22

@daften
Copy link
Author

daften commented Aug 28, 2021

It's related to the docker nginx configuration. If you look at the URL on the "add mobile app" page, you see that it uses http if behind a reverse proxy that uses X-Forwarded-Proto, because nowhere is the HTTPS env variable set to on. I know how to do that in a htaccess file, not for nginx (which is used in the docker container) unfortunately. But I'm guessing it must be possible. The URL can be changed manually, but it's easy to look over this and I think many people will make a mistake against this and run into a wall :)

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

No branches or pull requests

2 participants