Files
moreminimore-newastro/nginx.conf
2026-04-22 12:35:39 +07:00

29 lines
703 B
Nginx Configuration File

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript application/json;
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Main page
location / {
try_files $uri $uri/ $uri.html =404;
}
# SPA fallback for Astro static output
location ~ ^/[^.]*$ {
try_files $uri $uri.html =404;
}
}