forked from fa/breadcrumb-the-shire
61 lines
1.8 KiB
Plaintext
61 lines
1.8 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name example.com www.example.com;
|
|
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()" always;
|
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
|
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name example.com www.example.com;
|
|
|
|
client_max_body_size 10M;
|
|
|
|
ssl_certificate /etc/nginx/certs/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/certs/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_session_timeout 1d;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_tickets off;
|
|
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()" always;
|
|
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
|
add_header Strict-Transport-Security "max-age=31536000" always;
|
|
|
|
root /var/www/web;
|
|
index index.php;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param HTTPS on;
|
|
fastcgi_param HTTP_X_FORWARDED_PROTO https;
|
|
fastcgi_pass php:9000;
|
|
}
|
|
|
|
location ~* \.mjs$ {
|
|
default_type application/javascript;
|
|
try_files $uri =404;
|
|
expires 30d;
|
|
access_log off;
|
|
}
|
|
|
|
location ~* \.(css|js|png|jpg|jpeg|gif|svg|ico|webp)$ {
|
|
expires 30d;
|
|
access_log off;
|
|
}
|
|
}
|