@@ -17,25 +17,25 @@ FROM nginx:alpine
1717
1818COPY --from=builder /app/dist /usr/share/nginx/html
1919
20- # nginx.conf는 docker-compose volume mount 또는 별도 COPY로 제공
21- # 기본 설정: SPA fallback + API 프록시
22- RUN echo 'server { \n\
23- listen 3000; \n\
24- server_name localhost; \n\
25- root /usr/share/nginx/ html; \n\
26- index index.html; \n\
27- location / { try_files $uri $uri/ /index.html ; } \n\
28- location /api/ { \n\
29- proxy_pass http://gateway:8080; \n\
30- proxy_set_header Host $host; \n\
31- proxy_set_header X-Real-IP $remote_addr; \n\
32- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; \n\
33- proxy_http_version 1.1; \n\
34- proxy_read_timeout 300s; \n\
35- } \n\
36- gzip on; \n\
37- gzip_types text/plain text/css application/json application/javascript text/xml; \n\
38- }' > /etc/nginx/conf.d/default.conf
20+ # SPA fallback + API 프록시
21+ RUN printf 'server {\n\
22+ listen 3000; \n\
23+ server_name localhost; \n\
24+ root /usr/share/nginx/html; \n\
25+ index index. html;\n\
26+ location / { try_files $uri $uri/ / index.html; } \n\
27+ location = /index.html { add_header Cache-Control "no-cache, no-store, must-revalidate" ; }\n\
28+ location /api/ {\n\
29+ proxy_pass http://gateway:8080;\n\
30+ proxy_set_header Host $host;\n\
31+ proxy_set_header X-Real-IP $remote_addr;\n\
32+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\
33+ proxy_http_version 1.1;\n\
34+ proxy_read_timeout 300s;\n\
35+ }\n\
36+ gzip on;\n\
37+ gzip_types text/plain text/css application/json application/javascript text/xml;\n\
38+ }\n ' > /etc/nginx/conf.d/default.conf
3939
4040EXPOSE 3000
4141
0 commit comments