From ed3e4dfc86a04e2dcb97afaa4f7ed3972126c3f6 Mon Sep 17 00:00:00 2001 From: yh-noh Date: Mon, 9 Nov 2026 16:02:45 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20nginx.conf=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EC=8B=9C=20inode=20=EC=9C=A0=EC=A7=80=20=EB=B0=A9=EB=B2=95=20?= =?UTF-8?q?=EC=95=88=EB=82=B4=20(504=20Known=20Issues)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 실행 중 nginx.conf 는 nginx 컨테이너에 단일 파일 bind mount 되어 있어 sed -i 로 수정하면 inode 가 바뀌어 reload 해도 반영되지 않는다. 수정본을 cat > 로 덮어써 inode 를 유지한 뒤 reload 하도록 절차를 바꾸고, nginx -T 로 적용값을 확인하는 단계와 sed -i 를 이미 쓴 경우 restart 안내를 추가한다. --- README.md | 12 ++++++++++-- README_kr.md | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f3b46ba..3af9682 100644 --- a/README.md +++ b/README.md @@ -368,11 +368,19 @@ The Web Console location (`:3001`) in `conf/docker/conf/mc-iam-manager/nginx.tem vi conf/docker/conf/mc-iam-manager/nginx.template.conf # 2. Apply to a running installation (generated file) -sed -i '/upstream_console/,/^ }/ s/proxy_read_timeout 120s;/proxy_read_timeout 180s;/' \ - conf/docker/container-volume/mc-iam-manager/nginx/nginx.conf +# Write the edited copy back with `cat >` so the file keeps its inode (see note below) +NGINX_CONF=conf/docker/container-volume/mc-iam-manager/nginx/nginx.conf +sed '/upstream_console/,/^ }/ s/proxy_read_timeout 120s;/proxy_read_timeout 180s;/' \ + "$NGINX_CONF" > /tmp/nginx.conf.new +cat /tmp/nginx.conf.new > "$NGINX_CONF" && rm /tmp/nginx.conf.new docker exec mc-iam-manager-nginx nginx -t && docker exec mc-iam-manager-nginx nginx -s reload + +# 3. Check the value nginx is actually using +docker exec mc-iam-manager-nginx nginx -T 2>/dev/null | grep proxy_read_timeout ``` +> **Note:** `nginx.conf` is bind-mounted into the container as a single file (`/etc/nginx/nginx.conf`). `sed -i` (and editors that save by replacing the file) creates a new file with a new inode, so the container keeps seeing the old content and `nginx -s reload` has no effect. If you already edited it that way, run `docker restart mc-iam-manager-nginx` instead of reload. + To confirm the cause, look for `upstream timed out ... while reading response header from upstream` in `docker logs mc-iam-manager-nginx` at the time of the 504. ## TLS Certificate Auto-Renewal (Mode B) diff --git a/README_kr.md b/README_kr.md index 36fbf4a..f9c1bb0 100644 --- a/README_kr.md +++ b/README_kr.md @@ -279,11 +279,19 @@ Mode A(자체 서명 인증서) → Mode B(Let's Encrypt)로 같은 도메인을 vi conf/docker/conf/mc-iam-manager/nginx.template.conf # 2. 기동 중인 설치에 반영(생성된 파일) -sed -i '/upstream_console/,/^ }/ s/proxy_read_timeout 120s;/proxy_read_timeout 180s;/' \ - conf/docker/container-volume/mc-iam-manager/nginx/nginx.conf +# 수정본을 `cat >` 로 덮어써서 파일 inode 를 유지(아래 참고) +NGINX_CONF=conf/docker/container-volume/mc-iam-manager/nginx/nginx.conf +sed '/upstream_console/,/^ }/ s/proxy_read_timeout 120s;/proxy_read_timeout 180s;/' \ + "$NGINX_CONF" > /tmp/nginx.conf.new +cat /tmp/nginx.conf.new > "$NGINX_CONF" && rm /tmp/nginx.conf.new docker exec mc-iam-manager-nginx nginx -t && docker exec mc-iam-manager-nginx nginx -s reload + +# 3. nginx 가 실제로 쓰는 값 확인 +docker exec mc-iam-manager-nginx nginx -T 2>/dev/null | grep proxy_read_timeout ``` +> **참고:** `nginx.conf` 는 컨테이너에 단일 파일(`/etc/nginx/nginx.conf`)로 bind mount 됩니다. `sed -i`(및 파일을 새로 만들어 교체하는 방식으로 저장하는 편집기)는 inode 가 바뀐 새 파일을 만들기 때문에, 컨테이너는 옛 내용을 계속 보고 `nginx -s reload` 해도 반영되지 않습니다. 이미 그렇게 수정했다면 reload 대신 `docker restart mc-iam-manager-nginx` 를 실행합니다. + 원인 확인: 504 발생 시각의 `docker logs mc-iam-manager-nginx` 에 `upstream timed out ... while reading response header from upstream` 이 있는지 봅니다. ## TLS 인증서 자동갱신 (Mode B)