Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix(dockerfile): support SPA refresh to resolve nginx return 404 (#384)

Niceaf75cedb0e0
diff --git a/Dockerfile b/Dockerfile
index 84698c51..6c81357c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,6 +16,7 @@ RUN npm run build
FROM nginx:stable-alpine AS production
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
+COPY ./default.conf /etc/nginx/conf.d/default.conf
# Expose the default port for the Nginx web server
EXPOSE 80
diff --git a/default.conf b/default.conf
new file mode 100644
index 00000000..171ca3cb
--- /dev/null
+++ b/default.conf
@@ -0,0 +1,15 @@
+server {
+ listen 80;
+ listen [::]:80;
+
+ location / {
+ root /usr/share/nginx/html;
+ index index.html index.htm;
+ try_files $uri $uri/ /index.html;
+ }
+
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root /usr/share/nginx/html;
+ }
+}