Skip to content

Proxito: do https redirects at the middleware level #10144

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

Closed
stsewd opened this issue Mar 13, 2023 · 1 comment · Fixed by #10199
Closed

Proxito: do https redirects at the middleware level #10144

stsewd opened this issue Mar 13, 2023 · 1 comment · Fixed by #10199
Labels
Needed: design decision A core team decision is required

Comments

@stsewd
Copy link
Member

stsewd commented Mar 13, 2023

Currently, we are doing http->https redirects for docs pages only, things that aren't docs pages, like proxied APIs aren't being redirected.

return RedirectType.http_to_https

This is only relevant on .org, since on .com we do the http->https redirects at the nginx level for both, custom domains and public domains.

But since we want to remove all that logic from nginx and rely on proxito, we need to redirect all requests, not just docs pages.
Another solution can be to just always redirect to https on .org as we do on .com, that way we could just use https://docs.djangoproject.com/en/3.2/ref/settings/#std-setting-SECURE_SSL_REDIRECT (but we will be losing some control about caching those types of redirects if we use that setting instead of doing it manually)

@ericholscher
Copy link
Member

Another solution can be to just always redirect to https on .org as we do on .com, that way we could just use https://docs.djangoproject.com/en/3.2/ref/settings/#std-setting-SECURE_SSL_REDIRECT (but we will be losing some control about caching those types of redirects if we use that setting instead of doing it manually)

If we're losing our cache headers, I'm fine handling it ourselves 👍

stsewd added a commit that referenced this issue Mar 28, 2023
In order to be able to cache the redirects,
I had to refactor some of our code
(and kind of a little in the direction of #10124).

Closes #10144
stsewd added a commit that referenced this issue Apr 19, 2023
In order to be able to cache the redirects,
I had to refactor some of our code
(and kind of a little in the direction of #10124).

Closes #10144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants