From c8b0a78973e2ade7f8d8fe58725584f136e61b45 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sun, 29 Mar 2026 21:50:50 +0200 Subject: [PATCH] fix: add nginx SPA fallback to serve index.html for all routes Prevents 404 errors when navigating directly to client-side routes. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 1 + nginx.conf | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index c2e1b4b..f1464f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,7 @@ RUN pnpm run build FROM nginx:alpine AS runner COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f749e02 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +}