77 lines
2.0 KiB
Plaintext
77 lines
2.0 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name midctrl.com www.midctrl.com;
|
|
|
|
return 301 https://midctrl.com$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name www.midctrl.com;
|
|
|
|
ssl_certificate /etc/ssl/cloudflare/cert.pem;
|
|
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
|
|
|
|
return 301 https://midctrl.com$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name midctrl.com;
|
|
|
|
root /var/www/midctrl.com;
|
|
index index.html;
|
|
|
|
ssl_certificate /etc/ssl/cloudflare/cert.pem;
|
|
ssl_certificate_key /etc/ssl/cloudflare/key.pem;
|
|
|
|
charset utf-8;
|
|
server_tokens off;
|
|
|
|
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'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'none'; upgrade-insecure-requests" always;
|
|
|
|
location = /index.html {
|
|
expires -1;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~* ^/assets/(?:css|js)/.+\.(?:css|js|json)$ {
|
|
expires -1;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ^~ /assets/images/ {
|
|
expires 7d;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ^~ /assets/fonts/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Merge host-private application locations from the existing server
|
|
# configuration here. Do not store their paths or upstreams in Git.
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
error_page 404 /404.html;
|
|
location = /404.html {
|
|
internal;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css application/javascript application/json application/manifest+json image/svg+xml application/xml;
|
|
}
|