From a3b917ee737ed5c3bcd881a564217493adfd05b5 Mon Sep 17 00:00:00 2001 From: tilde services Date: Mon, 29 Apr 2019 22:09:03 -0400 Subject: [PATCH] add nginx conf and systemd unit --- 0x0.service | 18 ++++++++++++++++++ nginx.conf | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 0x0.service create mode 100644 nginx.conf diff --git a/0x0.service b/0x0.service new file mode 100644 index 0000000..b6d029d --- /dev/null +++ b/0x0.service @@ -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 + diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..1a7c3c1 --- /dev/null +++ b/nginx.conf @@ -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; + } +} +