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

Fix #934 infinite redirects with SSL HTTPS & NGIX #935

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

gregelin
Copy link
Contributor

@gregelin gregelin commented Jun 12, 2020

Fixes two issues. Fixes #934.

First, updates NGINX configuration files to pass $request_uri
port of URL from port 80 to port 443. Failing to pass $request_uri
tosses user (and non-users with invites) to home page rather than
requested url.

Second, and more signficantly, scheme https in govready-url
parameter was also setting SECURE_SSL_REDIRECT at the Django app
causing infinite redirects behind an NGINX reverse proxy that was
terminating the SSL connection and passing to local http://localhost:8000.
Fix was to let SECURE_SSL_REDIRECT remain its default False and
add new parameter secure_ssl_redirect for situations when deployment
called on Django to handle redirect.

Fixes two issues.

First, updates NGINX configuration files to pass $request_uri
port of URL from port 80 to port 443. Failing to pass $request_uri
tosses user (and non-users with invites) to home page rather than
requested url.

Second, and more signficantly, scheme `https` in `govready-url`
parameter was also setting `SECURE_SSL_REDIRECT` at the Django app
causing infinite redirects behind an NGINX reverse proxy that was
terminating the SSL connection and passing to local `http://localhost:8000`.
Fix was to let `SECURE_SSL_REDIRECT` remain its default `False` and
add new parameter `secure_ssl_redirect` for situations when deployment
called on Django to handle redirect.
@gregelin gregelin merged commit 3badfad into master Jun 12, 2020
@gregelin gregelin deleted the gelin/fix-934-infinite-ssl-redirects branch June 12, 2020 12:05
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.

Infinite redirects with SSL HTTPS behind NGINX reverse proxy depending on configuration
2 participants