Finally tracked down the solution. The request.is_secure(); isn't looking
for the HTTP_X_FORWARDED_PROTOCOL to test for HTTPS so its always returning
that its not secure. To fix it I had to add the below to my settings.py
file.
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
Also I see that line in the deploy local_settings.py.template file.
On Friday, November 14, 2014 9:08:57 AM UTC-7, Josh B wrote:
>
> Thanks, Josh.
>
> I have tried with that set or left blank and I get the same thing. I have
> also removed the SSL config parameters and just use default ones and I
> still get the redirect. Looking through all of the Cartridge sites I have
> built this is the issue that has always alluded me.
>
> On Friday, November 14, 2014 8:22:13 AM UTC-7, Josh Cartmell wrote:
>>
>> I've had issues with redirects and SSL before if I put in the wrong
>> "Force host" which is a backend editable setting.
>>
>> On Fri, Nov 14, 2014 at 3:19 AM, Josh B <[email protected]>
>> wrote:
>>
>>> I must be missing something, but the last few Nginx + Cartridge sites I
>>> have launched I have to https the whole the site. If I don't the sections I
>>> need SSL on just do a 302 redirect loop.
>>>
>>> Here are my settings:
>>>
>>> SSL_ENABLED = True
>>> SSL_FORCE_URL_PREFIXES = ('/shop/cart','/shop/checkout','/account',
>>> '/admin')
>>> SSL_FORCED_PREFIXES_ONLY = True
>>>
>>> I also enabled the SSL middleware.
>>>
>>> My Nginx config matches the one provided.
>>>
>>> Thoughts?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.