mirror of
https://github.com/aljazceru/mutiny-net.git
synced 2025-12-17 05:54:22 +01:00
59 lines
2.3 KiB
Plaintext
59 lines
2.3 KiB
Plaintext
server {
|
|
server_name rgs.mutinynet.com;
|
|
root /var/www/rgs;
|
|
|
|
location / {
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
|
add_header 'Access-Control-Max-Age' 1728000 always;
|
|
add_header 'Content-Type' 'text/plain; charset=utf-8' always;
|
|
add_header 'Content-Length' 0 always;
|
|
return 204;
|
|
}
|
|
if ($request_method = 'GET') {
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
}
|
|
if ($request_method = 'POST') {
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
}
|
|
|
|
index index.html; # Default files to serve
|
|
}
|
|
|
|
location /snapshot {
|
|
try_files $uri $uri/ /res/symlinks/$1.bin;
|
|
autoindex on;
|
|
rewrite ^/snapshot/(\d+)$ /snapshot/$1.bin break;
|
|
rewrite ^/snapshot/(\d+)\.bin$ /snapshot/$1 break;
|
|
}
|
|
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/mutinynet.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/mutinynet.com/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
|
|
|
|
|
|
}
|
|
server {
|
|
if ($host = rgs.mutinynet.com) {
|
|
return 301 https://$host$request_uri;
|
|
} # managed by Certbot
|
|
|
|
|
|
server_name rgs.mutinynet.com;
|
|
listen 80;
|
|
return 404; # managed by Certbot
|
|
|
|
|
|
}
|