diff --git a/Dockerfile b/Dockerfile index ff17350..624c032 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN pnpm run build FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..5bfcc78 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,27 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri.html $uri/index.html $uri/index.htm $uri/ =404; + } + + location /.well-known/ { + root /usr/share/nginx/html; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods "GET, OPTIONS"; + } + + error_page 404 /404.html; + location = /404.html { + root /usr/share/nginx/html; + internal; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + internal; + } +}