nginx stuff

This commit is contained in:
ntr 2019-08-17 17:51:55 +10:00
parent 16322fdaa1
commit f664dc6ebc
2 changed files with 22 additions and 12 deletions

View File

@ -1,5 +1,3 @@
error_log /var/log/mnml/nginx.log;
upstream mnml_http { upstream mnml_http {
server 127.0.0.1:40000; server 127.0.0.1:40000;
} }

View File

@ -1,5 +1,3 @@
error_log /var/log/mnml/nginx.log;
upstream mnml_http { upstream mnml_http {
server 127.0.0.1:40000; server 127.0.0.1:40000;
} }
@ -17,18 +15,11 @@ map $http_upgrade $connection_upgrade {
# DEV # DEV
server { server {
location / { location / {
root /var/lib/mnml/public/client; root /var/lib/mnml/public/current;
index index.html; index index.html;
try_files $uri $uri/ index.html; try_files $uri $uri/ index.html;
} }
# this will be handled by a separate domain
location /acp {
root /var/lib/mnml/public/acp;
index acp.html;
try_files $uri $uri/ acp.html;
}
location /imgs/ { location /imgs/ {
root /var/lib/mnml/public/; root /var/lib/mnml/public/;
try_files $uri $uri/ =404; try_files $uri $uri/ =404;
@ -54,3 +45,24 @@ server {
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
} }
server {
server_name grep.live;
location / {
root /var/lib/mnml/public/current/;
index acp.html;
try_files $uri $uri/ acp.html;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/grep.live/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/grep.live/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
}
# http -> https
server {
return 301 https://$host$request_uri;
}