pyconca / 2013-web

a Django project for conference websites
https://2013.pycon.ca/
BSD 3-Clause "New" or "Revised" License
6 stars 9 forks source link

https://2013.pycon.ca redirects to http://2013.pycon.ca/en/ #57

Closed eloraburns closed 11 years ago

eloraburns commented 11 years ago

Probably an issue with the django i18n redirect

MichaelDiBernardo commented 11 years ago

Crazy question but you guys don't have a protocol hardcoded into the site record do you? (In django_site table)

kayzhu commented 11 years ago

Hey Taavi! I think this is the expected behavior..

kayzhu commented 11 years ago

Scratch that.. I should read more carefully before I type..

eloraburns commented 11 years ago

django/http/__init__.py line 271: settings.SECURE_PROXY_SSL_HEADER

Thinking that NGINX is probably setting something useful for us to read; we just have to tell Django what to trust.

MichaelDiBernardo commented 11 years ago

Hey, I don't think this is the i18n stuff causing the problem -- it's doing it on any redirect. (Go to sign up, for example, and on the redirect to next, you'll go back to HTTP)

eloraburns commented 11 years ago

Yeah, I think we new to set the proxy ssl setting appropriately.

taa /eof/

On 2013-05-10, at 17:25, Michael DiBernardo notifications@github.com wrote:

Hey, I don't think this is the i18n stuff causing the problem -- it's doing it on any redirect. (Go to sign up, for example, and on the redirect to next, you'll go back to HTTP)

— Reply to this email directly or view it on GitHub.

eloraburns commented 11 years ago

Peeking at our nginx configuration I tried adding SECURE_PROXY_SSL_HEADER = ('X-Forwarded-Protocol', 'https') to local_settings.py, but no dice.

wolever commented 11 years ago

Poking at this now…

wolever commented 11 years ago

Oh, right… I have run into this one before. The problem is that you're supposed to know that when the name says "HEADER", it actually means "ENVIRONMENT VARIABLE": https://django-secure.readthedocs.org/en/latest/settings.html#secure-proxy-ssl-header

wolever commented 11 years ago

I've updated production… But I don't know what the procedure for properly saving and committing things is, so I've just left the files there. All is working now, though.

kayzhu commented 11 years ago

:+1:

eloraburns commented 11 years ago

What changes were those? I don't see any orphan changes in prod…

On May 10, 2013, at 22:08, David Wolever wrote:

I've updated production… But I don't know what the procedure for properly saving and committing things is, so I've just left the files there. All is working now, though.

— Reply to this email directly or view it on GitHub.

taa /eof/

eloraburns commented 11 years ago

I think the reason I didn't think it was working before is that the Makefile was referring to a newly-defunct supervisord task ("2013-staging"). On actually restarting gunicorn, things started to work. At least, that's my guess as to what happened.

eloraburns commented 11 years ago

I think we fixed this, eventually.