You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
Apologies in advance if this isn't the appropriate place to note the following.
When using django-sslify with an app behind Cloudflare, you have to have the Cloudflare SSL option set to "Full SSL" (or possibly "Off", but I'm unable to test that).
This is because if you have the Cloudflare SSL option set to "Flexible", even if the user specifies an HTTPS connection, Cloudflare will then connect to your app without SSL (see image above) and HTTP_X_FORWARDED_PROTO will be set to http. This will cause an infinite redirect loop as django-sslify attempts to redirect the connection to HTTPS - starting the whole loop over again.
Whether this is worth noting in the README or better to close this issue as a record for others to find via google, I'll leave to you @rdegges 😃
The text was updated successfully, but these errors were encountered:
Hey @JeffPaine, thanks for the issue! I think I'll just leave that commented out in here, as I know there are tons of SSL proxies / CDNs out there that all have different ways of doing it,so I don't want to go too-specific.
But I'm sure people will at least find this useful when searching!
Also, the Full SSL option makes sense, since django-sslify forces SSL, regardless of the origin. That way, when a user hits cloudflare, we'll still require cloudflare to talk to us directly with SSL as well.
I think I'll just leave that commented out in here, as I know there are tons of SSL proxies / CDNs out there that all have different ways of doing it,so I don't want to go too-specific.
Good point, better to leave it general. Happy to help! Thanks again for the useful app!
But I'm sure people will at least find this useful when searching!
So, I was working through this issue today (a config issue, not the "fault" of django-sslify), and I'm searching GH and I find this very issue that I wrote up myself two years ago! Funny how time flies, the mind forgets and web (thankfully) doesn't. Cheers!
Apologies in advance if this isn't the appropriate place to note the following.
When using
django-sslify
with an app behind Cloudflare, you have to have the Cloudflare SSL option set to "Full SSL" (or possibly "Off", but I'm unable to test that).This is because if you have the Cloudflare SSL option set to "Flexible", even if the user specifies an HTTPS connection, Cloudflare will then connect to your app without SSL (see image above) and
HTTP_X_FORWARDED_PROTO
will be set tohttp
. This will cause an infinite redirect loop asdjango-sslify
attempts to redirect the connection to HTTPS - starting the whole loop over again.Whether this is worth noting in the README or better to close this issue as a record for others to find via google, I'll leave to you @rdegges 😃
The text was updated successfully, but these errors were encountered: