Skip to content

Commit ba237fb

Browse files
committed
hotfix: nginx prod setting
1 parent 017b09b commit ba237fb

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/cd-prod.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ jobs:
9797
cp -f "${DEPLOY_PATH_PROD}/nginx/conf.d/prod.conf" "${DEPLOY_PATH}/nginx/conf.d/prod.conf"
9898
9999
cd "${DEPLOY_PATH}"
100+
# Wait until shared nginx is actually running before exec commands.
101+
for i in {1..30}; do
102+
if docker compose ps --status running nginx | grep -q "nginx"; then
103+
break
104+
fi
105+
sleep 2
106+
done
107+
100108
docker compose exec -T nginx nginx -t
101109
docker compose exec -T nginx nginx -s reload
102110
docker compose exec -T nginx sh -c "grep -n 'api-prod.muneo.ai.kr\\|risk-detector\\|proxy_read_timeout\\|proxy_request_buffering' /etc/nginx/conf.d/prod.conf || true"

.github/workflows/cd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ jobs:
9191
docker compose pull app redis nginx
9292
docker compose up -d --remove-orphans app redis nginx
9393
94+
# Wait until nginx is actually running before exec commands.
95+
for i in {1..30}; do
96+
if docker compose ps --status running nginx | grep -q "nginx"; then
97+
break
98+
fi
99+
sleep 2
100+
done
101+
94102
# Apply updated bind-mounted nginx config without recreating container
95103
docker compose exec -T nginx nginx -t
96104
docker compose exec -T nginx nginx -s reload

nginx/conf.d/prod.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ server {
1010
http2 on;
1111

1212
server_name api-prod.muneo.ai.kr;
13+
resolver 127.0.0.11 ipv6=off valid=10s;
14+
set $prod_upstream app-prod:8080;
1315

1416
ssl_certificate /etc/nginx/certs/muneo.ai.kr.pem;
1517
ssl_certificate_key /etc/nginx/certs/muneo.ai.kr.key;
@@ -18,7 +20,7 @@ server {
1820

1921
# Long-running AI analysis endpoints need higher upstream timeouts than nginx defaults (60s).
2022
location = /api/v1/risk-detector/analyze {
21-
proxy_pass http://app-prod:8080;
23+
proxy_pass http://$prod_upstream;
2224

2325
proxy_http_version 1.1;
2426
proxy_request_buffering off;
@@ -35,7 +37,7 @@ server {
3537
}
3638

3739
location / {
38-
proxy_pass http://app-prod:8080;
40+
proxy_pass http://$prod_upstream;
3941

4042
proxy_http_version 1.1;
4143
proxy_connect_timeout 10s;

0 commit comments

Comments
 (0)