I’m running a django project using gunicorn, I’d like to run it using ssl, I found on internet that I need this dictionary “{‘X-FORWARDED-PROTOCOL’: ‘ssl’, ‘X-FORWARDED-SSL’: ‘on’}”.
But where do i put it? Is there a way to run it using ssl on command gunicorn_django?
Im not using nginx and I wouldn’t like to use.
Thanks.
I’m running a django project using gunicorn, I’d like to run it using ssl,
Share
Update: Gunicorn added SSL support as of 0.17.0 / 2012-12-25.
Original answer:
Gunicorn itself does not support SSL. There is an open pull request to add it https://github.com/benoitc/gunicorn/pull/265. The
X-FORWARDED-PROTOCOLandX-FORWARDED-SSLheaders would be used by a proxy (such as Nginx) in front of Gunicorn which does SSL termination.Using Nginx is not required to use SSL. You could use Apache/mod_proxy or HAProxy or any other proxy server which supports SSL. Even without the need for SSL the use of a proxy server is recommended when using Gunicorn to buffer slow clients http://gunicorn.org/deploy.html