From 86898d7c2f5b022b46fdc67a3effa9660a4d7d65 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 16 Feb 2026 19:43:56 +0000 Subject: [PATCH] Fix serving issue: remove index.txt and add explicit root route - Remove .txt files from build output that caused download prompts - Add explicit location = / rule to ensure index.html is served Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 1 + nginx.conf | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7efbf03..fd7fa90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,5 +8,6 @@ RUN npm run build FROM nginx:alpine COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /app/out /usr/share/nginx/html +RUN rm -f /usr/share/nginx/html/*.txt EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index b582317..c939c45 100644 --- a/nginx.conf +++ b/nginx.conf @@ -17,7 +17,11 @@ server { add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; - # Handle Next.js static export routes + # Serve index.html for root and all routes (SPA fallback) + location = / { + try_files /index.html =404; + } + location / { try_files $uri $uri.html $uri/index.html /index.html; }