From e1ac6e4c33542ab026f7ce0422a19446372a189f Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 27 Nov 2025 20:34:10 -0800 Subject: [PATCH] Fix nginx try_files to prefer .html over directories --- nginx.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 17808b4..557d00b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -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