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
|
||||
location / {
|
||||
# Try exact file, then .html extension, then directory, then fallback to index.html
|
||||
try_files $uri $uri.html $uri/ /index.html;
|
||||
# Try exact file, then .html extension, then directory index, then fallback
|
||||
# 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue