feat: Add Nginx configuration for SPA routing and static asset caching.
Build & Push Hospitality / build-and-push (push) Successful in 3m43s

This commit is contained in:
steinhelge
2025-11-25 20:10:47 +01:00
parent bde8e8bedc
commit 68ecdb0056
2 changed files with 20 additions and 0 deletions
+3
View File
@@ -22,5 +22,8 @@ WORKDIR /usr/share/nginx/html
# Legg inn bygget frontend
COPY --from=build /app/dist .
# Kopier custom nginx config for SPA routing
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Nginx server som statisk side
EXPOSE 80
+17
View File
@@ -0,0 +1,17 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Support for SPA routing
location / {
try_files $uri $uri/ /index.html;
}
# Optional: Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public, no-transform";
}
}