scripts
This commit is contained in:
@@ -17,7 +17,7 @@ map $http_upgrade $connection_upgrade {
|
||||
# DEV
|
||||
server {
|
||||
location / {
|
||||
root /var/lib/mnml/public/dist;
|
||||
root /var/lib/mnml/public/current;
|
||||
index index.html;
|
||||
try_files $uri $uri/ index.html;
|
||||
}
|
||||
|
||||
@@ -1,48 +1,51 @@
|
||||
error_log /var/log/mnml/nginx.error.log;
|
||||
access_log /var/log/mnml/nginx.access.log;
|
||||
error_log /var/log/mnml/nginx.log debug;
|
||||
|
||||
upstream mnml {
|
||||
upstream mnml_http {
|
||||
server 127.0.0.1:40000;
|
||||
}
|
||||
|
||||
upstream mnml_ws {
|
||||
server 127.0.0.1:40055;
|
||||
}
|
||||
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
# PRODUCTION
|
||||
# DEV
|
||||
server {
|
||||
root /var/lib/mnml/public/;
|
||||
index index.html;
|
||||
|
||||
server_name mnml.gg; # managed by Certbot
|
||||
|
||||
if ($host = minimal.gg) {
|
||||
return 301 https://mnml.gg$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
if ($host = cryps.gg) {
|
||||
return 301 https://mnml.gg$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
location / {
|
||||
root /var/lib/mnml/public/current;
|
||||
index index.html;
|
||||
try_files $uri $uri/ index.html;
|
||||
}
|
||||
|
||||
location /imgs/ {
|
||||
root /var/lib/mnml/public/;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location /api/ws {
|
||||
proxy_pass http://mnml_ws;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 600s;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://mnml_http;
|
||||
proxy_read_timeout 600s;
|
||||
}
|
||||
|
||||
listen [::]:443 ssl ipv6only=on; # managed by Certbot
|
||||
listen 443 ssl; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/mnml.gg/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/mnml.gg/privkey.pem; # managed by Certbot
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
||||
|
||||
location /ws {
|
||||
proxy_pass http://mnml;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 600s;
|
||||
}
|
||||
}
|
||||
|
||||
# http -> https
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[Unit]
|
||||
Description=OpenBSD Secure Shell server
|
||||
After=network.target auditd.service
|
||||
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
|
||||
Description=mnml game server
|
||||
After=postgresql
|
||||
User=mnml
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/mnml/bin/mnml
|
||||
ExecStart=/usr/local/mnml/bin/mnml
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
RestartPreventExitStatus=255
|
||||
|
||||
Reference in New Issue
Block a user