35 lines
800 B
Nginx Configuration File
35 lines
800 B
Nginx Configuration File
server {
|
|
listen 4321;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Static error pages generated by Astro (build.format: 'file')
|
|
error_page 400 /400.html;
|
|
error_page 403 /403.html;
|
|
error_page 404 /404.html;
|
|
error_page 408 /408.html;
|
|
error_page 429 /429.html;
|
|
error_page 451 /451.html;
|
|
error_page 500 /500.html;
|
|
error_page 502 /502.html;
|
|
error_page 503 /503.html;
|
|
error_page 504 /504.html;
|
|
error_page 520 /520.html;
|
|
error_page 521 /521.html;
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
# Hashed Astro assets — cache aggressively
|
|
location /_astro/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
gzip on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/css application/javascript image/svg+xml application/json;
|
|
}
|