fix: nginx cleanUrls routing for VitePress guides
This commit is contained in:
+5
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user