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
(SSL) Not able to set wsgi.url_scheme #51
Comments
fixed in latest head : pass an Http header to gunicorn : X-Forwarded-Protocol=https or X-Forwarded-Ssl=on Thanks for the feedback.
|
I set the X-Forwarded-Protocol to https in nginx config. I see that request.META.get('HTTP_X_FORWARDED_PROTOCOL') returns 'https'. But request.is_secure() is still false. Is it ok to write a decorator to check HTTP_X_FORWARDED_PROTOCOL and perform redirects to https ? or is there is a plan to get is_secure working in future. |
Try adding the X-Forwarded-Ssl=on too. |
what are the worker and gunicorn version you're using ? What is the result of wsgi.url_scheme ? Please open a new issue about it btw. |
Oh it seems that your http headers are wrong. To have |
I am using gunicorn 0.10 (yesterday's master). Currently my wsgi.url_scheme is http. I ll set the X-Forwarded-Protocol to ssl and let you how it works. |
Alright I configured nginx to set request.is_secure() is false in both cases. However this how request.META has
|
which worker ? |
Perhaps even more importantly, which version of Django? I'm almost positive that request.is_secure() has changed in the last few releases, we had a similar problem. |
Sorry for the delay. I tried to push SSL on our prod servers and had problems with the config. Had to rollback. I will post my config in the next couple of days and explain in detail |
I just stumbled upon this thread, i thought this might be relevant: http://github.com/rossdakin/django-heroism |
Relevant Django ticket: http://code.djangoproject.com/ticket/14597 |
I'm trying to deploy for production with Nginx + gunicorn + Django.
I bet there's a better way to do this, but I can't figure out how to set the wsgi.url_scheme environmental variable on gunicorn Request objects. It looks like it's hard-wired to 'http' right now, whereas I need it to be 'https' for the SSL segment of my site. For mod_wsgi, the solution is to kludge it in your wsgi.conf.py file like this: http://gist.github.com/78416#file_django_satchmo.wsgi
Is there any way to do this with gunicorn?
The text was updated successfully, but these errors were encountered: