Files

98 lines
3.2 KiB
Plaintext

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/projectquint;
index index.html;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
add_header Content-Security-Policy "default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'none'" always;
location = /updates/latest.json {
add_header Cache-Control "no-store" always;
try_files $uri =404;
}
location ^~ /downloads/ {
alias /srv/projectquint/releases/;
autoindex off;
default_type application/octet-stream;
add_header Cache-Control "public, max-age=31536000, immutable" always;
add_header Content-Disposition "attachment" always;
add_header X-Content-Type-Options "nosniff" always;
}
location / {
try_files $uri $uri/ =404;
}
location ~* \.(?:css|js|otf|ttf|png|jpg|jpeg|webp|ico)$ {
expires 7d;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
}
server {
listen 80;
listen [::]:80;
server_name projectquint.duckdns.org;
root /var/www/projectquint;
location ^~ /.well-known/acme-challenge/ {
try_files $uri =404;
}
location / {
return 301 https://projectquint.duckdns.org$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name projectquint.duckdns.org;
root /var/www/projectquint;
index index.html;
ssl_certificate /etc/letsencrypt/live/projectquint.duckdns.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/projectquint.duckdns.org/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
add_header Strict-Transport-Security "max-age=15552000" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
add_header Content-Security-Policy "default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'none'" always;
location = /updates/latest.json {
add_header Cache-Control "no-store" always;
try_files $uri =404;
}
location ^~ /downloads/ {
alias /srv/projectquint/releases/;
autoindex off;
default_type application/octet-stream;
add_header Cache-Control "public, max-age=31536000, immutable" always;
add_header Content-Disposition "attachment" always;
add_header X-Content-Type-Options "nosniff" always;
}
location / {
try_files $uri $uri/ =404;
}
location ~* \.(?:css|js|otf|ttf|png|jpg|jpeg|webp|ico)$ {
expires 7d;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
}