Skip to content

Commit 3ca9fb7

Browse files
committed
fix container routing issue
1 parent ceb92dd commit 3ca9fb7

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ FROM nginx:alpine
2121
# Copy built static files from builder
2222
COPY --from=builder /app/dist/temp/browser /usr/share/nginx/html
2323

24-
# Copy nginx configuration (optional)
25-
# COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
24+
# Copy nginx configuration
25+
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
2626

2727
# Expose port 80
2828
EXPOSE 80

docker/nginx.conf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
7+
# Enable gzip compression
8+
gzip on;
9+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
10+
11+
# Serve static files
12+
location / {
13+
try_files $uri $uri/ /index.html;
14+
}
15+
16+
# Cache static assets
17+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
18+
expires 1y;
19+
add_header Cache-Control "public, immutable";
20+
}
21+
22+
# Don't cache index.html
23+
location = /index.html {
24+
add_header Cache-Control "no-cache, no-store, must-revalidate";
25+
add_header Pragma "no-cache";
26+
add_header Expires "0";
27+
}
28+
}

0 commit comments

Comments
 (0)