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 <noreply@anthropic.com>
This commit is contained in:
parent
369ce58f40
commit
86898d7c2f
|
|
@ -8,5 +8,6 @@ RUN npm run build
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY --from=builder /app/out /usr/share/nginx/html
|
COPY --from=builder /app/out /usr/share/nginx/html
|
||||||
|
RUN rm -f /usr/share/nginx/html/*.txt
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,11 @@ server {
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
add_header Referrer-Policy "strict-origin-when-cross-origin" 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 / {
|
location / {
|
||||||
try_files $uri $uri.html $uri/index.html /index.html;
|
try_files $uri $uri.html $uri/index.html /index.html;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue