fix: nginx cleanUrls routing for VitePress guides

This commit is contained in:
sova-bootstrap
2026-05-28 13:48:25 +03:00
parent 41918487ff
commit 71424ca5f4
4 changed files with 8 additions and 5 deletions
+5 -2
View File
@@ -4,11 +4,14 @@ server {
root /usr/share/nginx/html;
index index.html;
# VitePress cleanUrls: each page is a *.html file on disk
location / {
try_files $uri $uri/ $uri/index.html /index.html;
try_files $uri $uri.html $uri/ $uri/index.html =404;
}
location ~* \.(html|css|js|json|svg|woff2?|png|jpg|jpeg|gif|ico)$ {
location ~* \.(html|css|js|json|svg|woff2?|png|jpg|jpeg|gif|ico|webp)$ {
add_header Cache-Control "public, max-age=3600";
}
error_page 404 /404.html;
}