server { listen 80; server_name me.hoelee.com; root /var/www/html; index index.html index.htm; client_max_body_size 100M; server_tokens off; # The site is a static Vue SPA: one HTML shell + hashed static/ assets. # No PHP is served (the php-fpm sidecar is a leftover of the template). # 139 KB of JS per visit went out uncompressed before this: enable gzip. gzip on; gzip_vary on; gzip_comp_level 5; gzip_min_length 256; gzip_proxied any; gzip_types text/plain text/css text/javascript application/javascript application/json application/manifest+json image/svg+xml font/woff2; # SPA fallback: unknown paths return the shell instead of hitting a missing index.php. location / { try_files $uri $uri/ /index.html; } # Filenames are content-hashed by Vite, so they can be cached forever. location /static/ { add_header Cache-Control "public, max-age=31536000, immutable"; access_log off; try_files $uri =404; } # The shell and the icons must be revalidated so a deploy is visible immediately. location = /index.html { add_header Cache-Control "no-cache"; } location = /robots.txt { add_header Cache-Control "public, max-age=3600"; } location = /favicon.ico { add_header Cache-Control "public, max-age=604800"; access_log off; } location ~ /\.ht { deny all; } }