add nginx conf and systemd unit

This commit is contained in:
tilde services 2019-04-29 22:09:03 -04:00
parent 2b7d0e5b20
commit a3b917ee73
2 changed files with 51 additions and 0 deletions

18
0x0.service Normal file
View File

@ -0,0 +1,18 @@
# /etc/systemd/system/nullpointer.service
[Unit]
Description=null pointer
After=0x0.service
[Service]
Type=simple
WorkingDirectory=/home/services/0x0
ExecStart=/usr/local/bin/uwsgi --socket 127.0.0.1:3031 --wsgi-file fhost.py --callable app --processes 4 --threads 2
User=services
Restart=always
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=default.target

33
nginx.conf Normal file
View File

@ -0,0 +1,33 @@
server {
listen 80;
listen [::]:80;
server_name ttm.sh;
return 307 https://$server_name$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name ttm.sh;
# include your certs
ssl_certificate /etc/letsencrypt/live/ttm.sh/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ttm.sh/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
root /home/services/0x0;
location / {
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
# make sure this matches the port you're running uwsgi on
uwsgi_pass 127.0.0.1:3031;
}
location /up {
internal;
}
}