On Aug 11, 7:43 am, Colleen A Josephson <[email protected]> wrote:
> That does exactly what I need, thank-you!
> ________________________________________
> From: [email protected] [[email protected]] On Behalf 
> Of Michael [[email protected]]
> Sent: Tuesday, August 10, 2010 5:25 PM
> To: [email protected]
> Subject: Re: SSL with Django, Apache, mod_wsgi and nginx
>
> On Tue, Aug 10, 2010 at 5:00 PM, Colleen A Josephson 
> <[email protected]<mailto:[email protected]>> wrote:
> Unfortunately I'm not very well versed in proxying and SSL, etc.
> I'm not sure I understand how mod WSGi eliminates the need for SSLRedirect.

Not a case of eliminating it, with nginx as front end proxy as
described in that blog post and with nginx handling HTTPS and Apache
only receiving requests as HTTP, you cant use SSLRedirect in Apache
because Apache will only ever see it as HTTP and using that directive
will cause a redirect loop. Thus instead of SSLRedirect, with that
configuration, you must use the equivalent in nginx as someone
described below.

BTW, the tip of tricking Django into thinking request is via HTTPS
even though it only handles it as HTTP is important. Instead of their
suggestion of modifying WSI script however, I would just use:

  SetEnvIf X-Forwarded-Protocol "^https$" HTTPS=on

With either fixup in place, you could also perhaps in Django
application use one of the methods available for check if connection
is_secure and redirecting if not.

Graham

> I implemented the Lincoln Loop setup, but if I go to the http:// admin page I 
> am not redirected to https:// as I would like to be.
>
> It would be much more efficient to redirect from nginx than django here. Just 
> implement something like this on your server that runs on port 80 (http):
>
> location /admin/ {
>      rewrite (.*)  https://$server_name$1 permanant;
>
> }
>
> This is just a snippit I just wrote. Let me know if it doesn't work, I will 
> actually go and run it.
>
> hope that helps,
>
> Michael
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to