commit
4bed38e707
22
config/nginx.conf
Normal file
22
config/nginx.conf
Normal 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
23
config/txtdot.init
Normal 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
13
config/txtdot.service
Normal 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
|
Loading…
x
Reference in New Issue
Block a user