From 36a0d29ff31a31cb184608025ce3b21bc11a60b6 Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Tue, 28 Jan 2025 12:17:47 +0100 Subject: [PATCH] deployment files, uwsgi + nginx --- deployment/call2025.ini | 18 +++++++++++++ deployment/xpub.nl.conf | 57 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 deployment/call2025.ini create mode 100644 deployment/xpub.nl.conf diff --git a/deployment/call2025.ini b/deployment/call2025.ini new file mode 100644 index 0000000..f9becb7 --- /dev/null +++ b/deployment/call2025.ini @@ -0,0 +1,18 @@ +# uwsgi.ini file +[uwsgi] + +plugin=python3 +chdir = /data/www/xpub.nl/wsgi/call2025 +home = /data/www/xpub.nl/wsgi/call2025/venv + +master = true +processes = 10 +uwsgi-socket = /data/www/xpub.nl/wsgi/call2025/sock/django.sock +chmod-socket = 666 +vacuum = true + +#uid = media +#gid = media + +mount = /2025/call=call2025.wsgi:application +manage-script-name=true diff --git a/deployment/xpub.nl.conf b/deployment/xpub.nl.conf new file mode 100644 index 0000000..fc37d19 --- /dev/null +++ b/deployment/xpub.nl.conf @@ -0,0 +1,57 @@ +### WWW.XPUB.NL + +upstream call { + server unix:/data/www/xpub.nl/wsgi/call2025/sock/django.sock; +} + +server { + server_name xpub.nl www.xpub.nl; + root /data/www/xpub.nl/www.xpub.nl; + index index.html index.htm; + + # forbid serving any . files and directories (like .git) + location ~ /\.(?!well-known).* { + deny all; + return 404; + access_log off; + log_not_found off; + } + + location / { + try_files $uri $uri/ =404; + autoindex on; + } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/xpub.nl/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/xpub.nl/privkey.pem; # managed by Certbot + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + + + location /2025/call/ { + uwsgi_pass call; + include uwsgi_params; + } + location /2025/call/static/ { + alias /data/www/xpub.nl/www.xpub.nl/2025/call/static/; + } + location /2025/call/media/ { + alias /data/www/xpub.nl/www.xpub.nl/2025/call/media/; + } + +} + +server { + if ($host = www.xpub.nl) { + return 301 https://$host$request_uri; + } # managed by Certbot + + if ($host = xpub.nl) { + return 301 https://$host$request_uri; + } # managed by Certbot + + listen 80; + server_name xpub.nl www.xpub.nl; + return 404; # managed by Certbot +}