Fix nginx try_files to prefer .html over directories
This commit is contained in:
parent
501ef48e53
commit
e1ac6e4c33
|
|
@ -18,8 +18,9 @@ server {
|
||||||
|
|
||||||
# Handle Next.js static export routes
|
# Handle Next.js static export routes
|
||||||
location / {
|
location / {
|
||||||
# Try exact file, then .html extension, then directory, then fallback to index.html
|
# Try exact file, then .html extension, then directory index, then fallback
|
||||||
try_files $uri $uri.html $uri/ /index.html;
|
# Note: $uri.html must come before $uri/ to handle directories without index.html
|
||||||
|
try_files $uri $uri.html $uri/index.html /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cache static assets
|
# Cache static assets
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue