diff --git a/docs/examples/nginx_gunicorn/gunicorn_start b/docs/examples/nginx_gunicorn/gunicorn_start index 542f89b..79cb44c 100755 --- a/docs/examples/nginx_gunicorn/gunicorn_start +++ b/docs/examples/nginx_gunicorn/gunicorn_start @@ -8,8 +8,9 @@ SOCKFILE=/srv/nsupdate/run/gunicorn.sock # communication socket PIDFILE=/srv/nsupdate/run/gunicorn.pid USER=www-data # the user to run as GROUP=www-data # the group to run as -NUM_WORKERS=3 # how many worker processes should Gunicorn spawn -DJANGO_SETTINGS_MODULE=nsupdate.settings.dev # which settings file should Django use +NUM_WORKERS=1 # how many worker processes should Gunicorn spawn + # note: use 1 for sqlite database, more for postgres +DJANGO_SETTINGS_MODULE=local_settings # which settings file should Django use DJANGO_WSGI_MODULE=nsupdate.wsgi # WSGI module name echo "Starting $NAME" diff --git a/docs/examples/nginx_gunicorn/nginx.conf b/docs/examples/nginx_gunicorn/nginx.conf index e959cf4..c4150f7 100644 --- a/docs/examples/nginx_gunicorn/nginx.conf +++ b/docs/examples/nginx_gunicorn/nginx.conf @@ -3,14 +3,11 @@ upstream nsupdate_server { } server { - listen :80; - server_name www.nsupdate.info; - return 301 http://nsupdate.info$request_uri; -} - -server { - listen :80; + listen 0.0.0.0:80; listen [::]:80; + listen 0.0.0.0:443 ssl; + listen [::]:443 ssl; + server_name nsupdate.info ipv4.nsupdate.info ipv6.nsupdate.info; access_log /srv/nsupdate/logs/nginx-access.log; @@ -31,4 +28,11 @@ server { } error_page 500 502 503 504 /500.html; + + ssl_certificate /etc/ssl/local/nsupdate.info.pem; + ssl_certificate_key /etc/ssl/private/nsupdate.info.pem; + + ssl_session_timeout 5m; + + include ssl_params; } diff --git a/nsupdate/settings/prod.py b/nsupdate/settings/prod.py index 4f421e2..6b37c6c 100644 --- a/nsupdate/settings/prod.py +++ b/nsupdate/settings/prod.py @@ -19,5 +19,5 @@ WWW_IPV4_HOST = 'ipv4.' + BASEDOMAIN # a host with ONLY a ipv4 address WWW_IPV6_HOST = 'ipv6.' + BASEDOMAIN # a host with ONLY a ipv6 address # Hosts/domain names that are valid for this site; required if DEBUG is False -# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts +# See https://docs.djangoproject.com/en/1.6/ref/settings/#allowed-hosts ALLOWED_HOSTS = [WWW_HOST, WWW_IPV4_HOST, WWW_IPV6_HOST]