From: Bryan Date: Sat, 8 Feb 2014 00:08:16 +0000 (-0500) Subject: updating nginx for SSL-only operation. closes #319 X-Git-Tag: release-20150131~169 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bc512cc0565451b4d8e2c6ef893598dd29c29c11;p=oweals%2Fkarmaworld.git updating nginx for SSL-only operation. closes #319 --- diff --git a/README.md b/README.md index f02354f..c631795 100644 --- a/README.md +++ b/README.md @@ -310,7 +310,13 @@ not generally be needed. server { listen 80; - listen 443 ssl; + server_name localhost; + return 301 https://$host$request_uri + } + + server { + listen 443; + ssl on; server_name localhost; client_max_body_size 20M; @@ -318,13 +324,7 @@ not generally be needed. # pass traffic through to gunicorn proxy_pass http://127.0.0.1:8000; # pass HTTP(S) status through to Django - if ($scheme ~ http) { - set $ssl 'off'; - } - if ($scheme ~ https) { - set $ssl 'on'; - } - proxy_set_header X-Forwarded-SSL $ssl; + proxy_set_header X-Forwarded-SSL $https; proxy_set_header X-Forwarded-Protocol $scheme; proxy_set_header X-Forwarded-Proto $scheme; # pass nginx site back to Django diff --git a/Vagrantfile b/Vagrantfile index 07725ed..c5089d7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -106,7 +106,13 @@ chown vagrant:vagrant karmaworld/$SECRETPATH/*.py cat > /etc/nginx/sites-available/karmaworld <