26 lines
581 B
Nginx Configuration File
26 lines
581 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# 404 fallback
|
|
error_page 404 /404.html;
|
|
|
|
# Static assets caching
|
|
location /_astro/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Redirect old article URLs (/articles/YYYY/MM/DD/slug/ -> /articles/YYYY-MM-DD-slug/)
|
|
location ~ "^/articles/(\d\d\d\d)/(\d\d)/(\d\d)/([^/]+)/?$" {
|
|
return 301 /articles/$1-$2-$3-$4/;
|
|
}
|
|
|
|
# Redirect old atom feed
|
|
location = /atom.xml {
|
|
return 301 /rss.xml;
|
|
}
|
|
}
|