chore: nginx upstream 설정 sed 명령어 수정 #368#369
Merged
Han-Joon-Hyeok merged 1 commit intomainfrom Mar 25, 2025
Hidden character warning
The head ref may contain hidden characters: "chore/bluegreen-\ubb34\uc911\ub2e8-\ubc30\ud3ec-\uc2a4\ud06c\ub9bd\ud2b8-\uc218\uc815#368"
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
blue/green 무중단 배포 중, green 컨테이너에서 blue 컨테이너로 전환이 정상적으로 이루어지지 않는 문제를 수정했습니다.
원인
nginx의 upstream이 green으로 바뀌지 않고 blue로 남아있던 것이 원인이었습니다.
nginx 설정 파일의 내용을 변경하기 위한 ShellScript에서 sed 명령어가 정상적으로 작동하지 않았기 때문입니다.
무중단 배포를 수행하기 전에 로컬 환경에 있는 변경 사항을 모두 되돌리는데, 이때 nginx 설정 파일의 upstream의 기본 값은 blue로 설정됩니다.
그러다보니 nginx 설정 파일에는
proxy_pass http://blue로 존재하게 되는데, sed 명령어가 찾고자 하는 문자열http://green을 찾지 못해http://blue로 변경하지 못했던 것입니다.작업 내용
sed 명령어가 찾고자 하는 문자열을
http://$current가 아닌proxy_pass http://를 찾도록 변경했습니다.