mirror of
https://github.com/headporter81/ss-front-react.git
synced 2026-12-06 07:41:11 +09:00
chore : nginx에서 /api 요청을 NAS 백엔드(18080)로 프록시
SpecialSource Frontend (React) CD / deploy (push) Successful in 12s
SpecialSource Frontend (React) CD / deploy (push) Successful in 12s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2a09fa80a9
commit
b50ea9e255
2 files changed
+20
No files matched your search
@@ -9,4 +9,5 @@ RUN npm run build
|
|||||||
# 2단계: nginx로 정적 파일 서비스 (기존 Vue 배포와 같은 방식)
|
# 2단계: nginx로 정적 파일 서비스 (기존 Vue 배포와 같은 방식)
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY --from=build /app/out /usr/share/nginx/html
|
COPY --from=build /app/out /usr/share/nginx/html
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
# 같은 도메인의 /api 요청을 NAS 백엔드 컨테이너(18080)로 전달 → 브라우저는 CORS 없이 호출
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://192.168.0.215:18080;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Next 정적 export: /about → about.html
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri.html $uri/ =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user