Skip to content

Instantly share code, notes, and snippets.

@ojas
Created June 7, 2019 19:44
Show Gist options
  • Save ojas/9d4bf89d5b70d64a2c34159287eabece to your computer and use it in GitHub Desktop.
Save ojas/9d4bf89d5b70d64a2c34159287eabece to your computer and use it in GitHub Desktop.
uwsgi & nginx
server {
listen 80;
server_name tch-activity.apps.sage-iq.com;
root /opt/www/tch-activity;
location / {
return 301 https://$host$request_uri;
}
location /.well-known {
alias /opt/www/tch-activity/.well-known;
}
}
server {
listen 443;
server_name tch-activity.apps.sage-iq.com;
client_max_body_size 20M;
ssl on;
ssl_certificate /etc/letsencrypt/live/tch-activity.apps.sage-iq.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/tch-activity.apps.sage-iq.com/privkey.pem;
location / {
uwsgi_pass unix:///tmp/tch-activity.sock;
include /etc/nginx/uwsgi_params;
}
location /.well-known {
alias /opt/www/tch-activity/.well-known;
}
}
---
# gzip_static on;
server {
listen 80;
server_name bidandbook.com www.bidandbook.com;
return 301 https://bidandbook.com$request_uri;
}
server {
listen 443;
server_name www.bidandbook.com;
return 301 https://bidandbook.com$request_uri;
ssl on;
ssl_certificate /etc/letsencrypt/live/bidandbook.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bidandbook.com/privkey.pem;
}
server {
listen 443;
server_name bidandbook.com;
client_max_body_size 20M;
ssl on;
ssl_certificate /etc/letsencrypt/live/bidandbook.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bidandbook.com/privkey.pem;
location / {
uwsgi_pass unix:///tmp/xactpad-prod.sock;
include /etc/nginx/uwsgi_params;
}
location /static {
alias /opt/www/xactpad-prod/static;
}
location /media {
alias /opt/www/xactpad-prod/media;
}
location /.well-known {
alias /opt/www/xactpad-prod/.well-known;
}
}
---
-rw-r--r-- 1 root root 342 Jul 20 2017 tch-activity.ini
-rw-r--r-- 2 root root 397 Jan 28 17:03 thecrowgroup.ini
-rw-r--r-- 1 root root 329 Feb 3 2017 xactpad-prod.ini
-rw-r--r-- 1 root root 334 Feb 3 2017 xactpad-stage.ini
ojas@sage-iq-apps:/etc/uwsgi/apps-enabled$ more xactpad-prod.ini
[uwsgi]
vhost = true
plugins-dir = /usr/lib/uwsgi/plugins
plugins = python3
socket = /tmp/xactpad-prod.sock
master = true
enable-threads = true
processes = 2
wsgi-file = /opt/www/xactpad-prod/django_xactpad/wsgi.py
virtualenv = /opt/www/xactpad-prod/env
chdir = /opt/www/xactpad-prod
touch-reload = /opt/www/xactpad-prod/reload
ojas@sage-iq-apps:/etc/uwsgi/apps-enabled$ more tch-activity.ini
[uwsgi]
vhost = true
plugins-dir = /usr/lib/uwsgi/plugins
plugins = python3
socket = /tmp/tch-activity.sock
master = true
enable-threads = true
processes = 2
wsgi-file = /opt/www/tch-activity/wsgi.py
virtualenv = /opt/www/tch-activity/env
chdir = /opt/www/tch-activity
touch-reload = /opt/www/tch-activity/reload
env = API_KEYS=Iacxn508kgsnz
ojas@sage-iq-apps:/etc/uwsgi/apps-enabled$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment