Browse Source

sample, maybe not-perfect-yet nginx & uwsgi confs, for intended easy/lazy deploy workflow

py3-upgrade
noah 2 years ago
parent
commit
1425bb1283
2 changed files with 86 additions and 0 deletions
  1. +48
    -0
      watershed.nginx.conf
  2. +38
    -0
      watershed.uwsgi.ini

+ 48
- 0
watershed.nginx.conf View File

@ -0,0 +1,48 @@
server {
listen 80;
listen [::]:80;
server_name watershed.nthall.com;
if ($host !~* ^.*.nthall.com$) {
return 444;
}
return 301 https://$server_name$request_uri;
access_log /var/log/nginx/watershed.access.log test;
error_log /var/log/nginx/watershed.error.log warn;
}
server {
listen 443 default_server ssl http2;
listen [::]:443 default_server ssl http2;
server_name watershed.nthall.com;
ssl_certificate /etc/letsencrypt/live/watershed.nthall.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/watershed.nthall.com/privkey.pem;
include snippets/ssl-params.conf;
access_log /var/log/nginx/watershed.access.log test;
error_log /var/log/nginx/watershed.error.log warn;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
alias /var/www/watershed/static/;
}
# letsencrypt renewal
location /.well-known/ {
allow all;
rewrite ^(.+)/+$ $1 permanent;
alias /var/www/.well-known/;
}
location / {
include /etc/nginx/uwsgi_params;
uwsgi_pass unix:///var/www/watershed/watershed.sock;
}
}

+ 38
- 0
watershed.uwsgi.ini View File

@ -0,0 +1,38 @@
# mysite_uwsgi.ini file
[uwsgi]
#key not in github no mo'
for-readline = /usr/share/django-apps/keys
env = %(_)
endfor =
virtualenv = /var/www/watershed/.venv/watershed/
# Django-related settings
# the base directory (full path)
chdir = /var/www/watershed
# Django's wsgi file
module = watershed.wsgi:application
logto = /var/log/uwsgi/app/watershed.log
pidfile = /var/www/watershed/pid
# process-related settings
# maximum number of worker processes
processes = 4
listen = 100
uid = www-data
gid = www-data
# the socket (use the full path to be safe
socket = /var/www/watershed/watershed.sock
# ... with appropriate permissions - may be needed
chmod-socket = 664
#chown-socket = www-data
# clear environment on exit
vacuum = true
enable-threads = true
thunder-lock = true
stats = /tmp/stats.socket

Loading…
Cancel
Save