HTTPS with gunicorn? -
i running gunicorn 19.0 on debian server serve django 1.8 site. running nginx serve site's static assets.
my dns managed gandi , have cloudflare in front of server. site running happily on http. serve on https. question how go this.
i have generated certificate following gandi's instructions. have server.csr
, myserver.key
file on server.
i have script run gunicorn , have amended point @ these certificate files:
exec gunicorn ${django_wsgi_module}:application \ --certfile=/home/me/server.csr --keyfile=/home/me/myserver.key --name $name \ --workers $num_workers \ --user=$user --group=$group \ --bind=unix:$sockfile \ --log-level=debug \ --log-file=-
the script seems run cleanly usual, if go https://example.com or http://example.com there nothing there (521 , 404 respectively).
is there additional step need carry out?
the gunicorn logs show following:
starting myapp hello [2015-06-25 10:28:18 +0000] [11331] [info] starting gunicorn 19.3.0 [2015-06-25 10:28:18 +0000] [11331] [error] connection in use: ('127.0.0.1', 8000) [2015-06-25 10:28:18 +0000] [11331] [error] retrying in 1 second. [2015-06-25 10:28:19 +0000] [11331] [error] connection in use: ('127.0.0.1', 8000) [2015-06-25 10:28:19 +0000] [11331] [error] retrying in 1 second. [2015-06-25 10:28:20 +0000] [11331] [error] connection in use: ('127.0.0.1', 8000) [2015-06-25 10:28:20 +0000] [11331] [error] retrying in 1 second. [2015-06-25 10:28:21 +0000] [11331] [error] connection in use: ('127.0.0.1', 8000) [2015-06-25 10:28:21 +0000] [11331] [error] retrying in 1 second. [2015-06-25 10:28:22 +0000] [11331] [error] connection in use: ('127.0.0.1', 8000) [2015-06-25 10:28:22 +0000] [11331] [error] retrying in 1 second. [2015-06-25 10:28:23 +0000] [11331] [error] can't connect ('127.0.0.1', 8000) /bin/bash: warning: setlocale: lc_all: cannot change locale (en_us)
i'm confused because of gunicorn examples talk .crt
files, have .csr
file.
what @steveklein says above in comments:
ssl should set in nginx config, not gunicorn one. when set nginx, you'll need decide if want serve both plain text , ssl or redirect ssl.
Comments
Post a Comment