systemd-unit-nginx-conf #10
2 changed files with 46 additions and 0 deletions
30
proxy/nginx/blasta.conf
Normal file
30
proxy/nginx/blasta.conf
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
map $http_upgrade $connection_upgrade { default upgrade; '' close; } server {
|
||||||
|
server_name blasta.example.tld;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/blasta/access.log;
|
||||||
|
error_log /var/log/nginx/blasta/error.log;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:11112;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_read_timeout 3600;
|
||||||
|
}
|
||||||
|
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
listen 443 ssl http2;
|
||||||
|
ssl_certificate /etc/letsencrypt/live/blasta.example.tld/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/blasta.example.tld/privkey.pem;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen [::]:80;
|
||||||
|
listen 80;
|
||||||
|
server_name blasta.example.tld;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
}
|
16
systemd/blasta.service
Normal file
16
systemd/blasta.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# /etc/systemd/system/blasta.service
|
||||||
|
[Unit]
|
||||||
|
Description=Blasta Bookmarks Service
|
||||||
|
After=network.target
|
||||||
|
Requisite=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/uvicorn blasta:app --port 11112
|
||||||
|
User=blasta
|
||||||
|
Restart=always
|
||||||
|
RestartSec=20s
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory=/home/blasta/Blasta
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue