From 972ffe6f69cd9a305d422bc6d27eaa5ce257a935 Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Wed, 29 Mar 2023 00:11:29 +0200 Subject: [PATCH] fix(docker): nginx config to redirect to index.html --- Dockerfile | 1 + nginx.conf | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index af4776c16..b0e338205 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,5 +9,6 @@ RUN pnpm build # production stage FROM nginx:stable-alpine as production-stage COPY --from=build-stage /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 000000000..1a30e15e4 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file