fix: Add nginx SPA routing config
Deploy Development / deploy (push) Successful in 33s

This commit is contained in:
Lars committed 2026-04-21 16:30:11 +02:00
1 parent b1c5999f6e
commit e4d052f182
2 files changed
+19 -2

No files matched your search

+2 -2
View File
@@ -25,8 +25,8 @@ FROM nginx:alpine
# Copy built app
COPY --from=build /app/dist /usr/share/nginx/html
# Copy nginx config (if exists)
# COPY nginx.conf /etc/nginx/nginx.conf
# Copy nginx config for SPA routing
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
+17
View File
@@ -0,0 +1,17 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# SPA routing - serve index.html for all routes
location / {
try_files $uri $uri/ /index.html;
}
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}