Merge pull request #43 from TxtDot/configs

Configs
This commit is contained in:
Artemy Egorov 2023-08-31 16:39:41 +03:00 committed by GitHub
commit 4bed38e707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 58 additions and 0 deletions

22
config/nginx.conf Normal file
View File

@ -0,0 +1,22 @@
limit_req_zone $binary_remote_addr zone=txtdotapi:10m rate=2r/s;
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name txt.dc09.ru;
location / {
limit_req zone=txtdotapi burst=4;
proxy_pass http://127.0.0.1:8080;
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;
}
location /static/ {
alias /home/txtdot/src/dist/static/;
}
}

23
config/txtdot.init Normal file
View File

@ -0,0 +1,23 @@
#!/sbin/openrc-run
name=$RC_SVCNAME
command="/usr/bin/node"
command_args="./src/app.js"
command_user="txtdot"
directory="/home/txtdot/src/dist"
output_log="/var/log/$RC_SVCNAME/txtdot.log"
error_log="/var/log/$RC_SVCNAME/error.log"
pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid"
stopsig="KILL"
command_background="yes"
depend() {
need net
}
start_pre() {
checkpath --directory --owner $command_user:$command_user --mode 0775 \
/run/$RC_SVCNAME /var/log/$RC_SVCNAME
}

13
config/txtdot.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=txtdot proxy server
After=network.target
[Service]
User=txtdot
Group=txtdot
WorkingDirectory=/home/txtdot/src/dist
ExecStart=/usr/bin/node ./src/app.js
Restart=always
[Install]
WantedBy=default.target