From 569d1006525f1c444650cc5403833069489e0246 Mon Sep 17 00:00:00 2001 From: h202-wq Date: Tue, 18 Aug 2026 19:10:25 -0400 Subject: [PATCH] Fixed bad gateway --- Dockerfile | 4 ++-- nginx.conf | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index fe29df5..db4b621 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,5 +7,5 @@ RUN npm run build FROM nginx:1.27-alpine COPY --from=build /app/dist /usr/share/nginx/html -EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..1fc2821 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,22 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + gzip on; + gzip_types text/css application/javascript application/json image/svg+xml; + + location / { + try_files $uri $uri/ /index.html; + } + + location = /index.html { + add_header Cache-Control "no-cache"; + } + + location ~* \.(?:css|js|json|svg|woff2?)$ { + add_header Cache-Control "public, max-age=604800, immutable"; + try_files $uri =404; + } +} \ No newline at end of file