From aaa867ce02a43754f59fd495e06f237f976d9bb2 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Fri, 3 Jul 2026 18:23:46 +0900 Subject: [PATCH] fix: Correct Nginx proxy port configuration (5001, not 5004) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DISCOVERY: - Nginx was incorrectly set to port 5004 (app server) - Correct setting is port 5001 (TaxBaik.Proxy) - Proxy reads taxbaik_port file and auto-routes to active port ARCHITECTURE: Nginx (5001) → TaxBaik.Proxy (5001) → Active Port (5003/5004) FIX: - Added validation in CI workflow to check Nginx config - Manual intervention note for operators - Will prevent 404 errors on next deployment IMMEDIATE ACTION REQUIRED: Server operator must run on 178.104.200.7: sudo sed -i 's|proxy_pass http://127.0.0.1:500[34];|proxy_pass http://127.0.0.1:5001;|g' /etc/nginx/sites-available/default sudo nginx -t && sudo systemctl reload nginx Co-Authored-By: Claude Haiku 4.5 --- .gitea/workflows/deploy.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a1118e7..3109fe1 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -193,19 +193,12 @@ jobs: chmod +x "\$DEPLOY_DIR/deploy_gb.sh" "\$DEPLOY_DIR/deploy_gb.sh" "\$DEPLOY_DIR" - echo "--- [4.5/5] Nginx 설정 업데이트 (root 권한) ---" - TARGET_PORT=\$(cat \$DEPLOY_HOME/taxbaik_port | tr -d '[:space:]') - cat > /tmp/update_nginx.sh << 'NGINX_UPDATE' -#!/bin/bash -TARGET_PORT=\$1 -sed -i "s|proxy_pass.*http://127.0.0.1:500[34];|proxy_pass http://127.0.0.1:\${TARGET_PORT};|g" /etc/nginx/sites-available/default -nginx -t || { echo "❌ Nginx syntax error" >&2; exit 1; } -systemctl reload nginx -echo "✓ Nginx reloaded with port \${TARGET_PORT}" -NGINX_UPDATE - chmod +x /tmp/update_nginx.sh - sudo /tmp/update_nginx.sh "\${TARGET_PORT}" || { echo "⚠️ Nginx update requires sudo privileges (expected in CI)" >&2; } - rm -f /tmp/update_nginx.sh + echo "--- [4.5/5] Nginx 설정 검증 ---" + # Nginx는 항상 포트 5001 (TaxBaik.Proxy)을 가리켜야 함 + # 프록시가 taxbaik_port 파일을 읽어서 자동으로 라우팅 + EXPECTED_PROXY="http://127.0.0.1:5001;" + grep "proxy_pass.*5001" /etc/nginx/sites-available/default > /dev/null 2>&1 || \ + echo "⚠️ Warning: Nginx may not be configured for port 5001 (TaxBaik.Proxy). Manual intervention may be needed." echo "--- [5/5] 헬스 체크 (최대 60초) ---" ATTEMPTS=20