93 lines
2.7 KiB
Nginx Configuration File
93 lines
2.7 KiB
Nginx Configuration File
worker_processes auto;
|
|
pid /tmp/nginx.pid;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
use epoll;
|
|
multi_accept on;
|
|
}
|
|
|
|
http {
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
keepalive_timeout 65;
|
|
server_tokens off;
|
|
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
charset utf-8;
|
|
|
|
access_log /dev/stdout;
|
|
error_log /dev/stderr;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css text/xml text/javascript
|
|
application/javascript application/xml+rss
|
|
application/json image/svg+xml;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Security headers
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' https://static.cloudflareinsights.com; object-src 'none';" always;
|
|
|
|
# Favicon: serve at standard /favicon.ico location
|
|
location = /favicon.ico {
|
|
alias /usr/share/nginx/html/assets/logos/favicon.png;
|
|
expires 7d;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
access_log off;
|
|
}
|
|
|
|
# Logo assets: 1 hour cache
|
|
location ~* ^/assets/logos/ {
|
|
expires 1h;
|
|
add_header Cache-Control "public, max-age=3600";
|
|
}
|
|
|
|
# Temporary: Disable caching during development
|
|
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 10m;
|
|
add_header Cache-Control "public, immutable";
|
|
# add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
# add_header Pragma "no-cache";
|
|
# add_header Expires "0";
|
|
}
|
|
|
|
location ~* \.html$ {
|
|
expires 10m;
|
|
add_header Cache-Control "public";
|
|
# add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
# add_header Pragma "no-cache";
|
|
# add_header Expires "0";
|
|
}
|
|
|
|
location ~* \.json$ {
|
|
expires 1d;
|
|
add_header Cache-Control "public, must-revalidate";
|
|
}
|
|
|
|
location /health {
|
|
access_log off;
|
|
return 200 'healthy\n';
|
|
add_header Content-Type text/plain;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
error_page 404 /index.html;
|
|
}
|
|
} |