feat: nginx upstream keepalive 10 → 16 튜닝 - #14
Merged
Conversation
통합: 보안/안정성 보강 3건 (reset 권한, CORS, stats 락)
deploy: 보안 점검 반영분 배포
PAT 기반 GHCR_TOKEN이 denied 에러를 내는 문제 해결. - docker/login-action@v3로 교체하고 자동 발급되는 GITHUB_TOKEN 사용 - permissions: packages: write 추가 - EC2 pull도 동일 토큰으로 인증 (envs로 전달)
랜딩페이지 JS가 브라우저에 API Key를 노출하지 않고 데모를 실행하도록 `/demo/*` 프록시 라우트를 추가. 내부에서 기존 `/api/*` 핸들러를 직접 호출. - 기존 `/api/*` 는 API Key 인증 유지 (서버-to-서버 용도) - `/demo/*` 는 인증 없이 호출 가능 (브라우저 데모 전용) - 파괴적 작업 (`DELETE /api/reset`) 은 의도적으로 프록시하지 않음 - 랜딩페이지 JS 경로 `/api/*` → `/demo/*` 로 전환 (reset 제외) 테스트 7개 추가 (BFF 동작 + `/api/*` 회귀 확인).
feat: 랜딩페이지용 BFF 프록시 라우트
익명 쓰기를 허용하면 rate limit 없는 상태에서 DB 오염 가능. 포트폴리오 시연 + 보안 요구를 동시에 만족하려면 조회만 공개하는 게 맞음. - /demo/* 에서 POST/PUT 라우트 제거 (조회 엔드포인트만 유지) - 랜딩 JS: 쓰기 버튼은 /api/* 로 복귀 (키 없으면 401 = 의도한 응답) - 랜딩 상단에 인증 안내 배너 추가 (GET=공개, 쓰기=키 필요) - 테스트 3개 추가 (쓰기 라우트 차단 확인), 회귀 테스트 2개
refactor: demo 프록시를 조회 전용으로 축소
로컬 부하 테스트(wrk 4t/100c/20s, /health_check) 결과 keepalive 16에서 RPS +26%, p99 레이턴시 −28% 개선 확인. 32 이상은 timeout 발생하여 16을 sweet spot으로 채택. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
keepalive 10→keepalive 16keepalive_timeout 5/keepalive_requests 1000은 유지Test plan
docker compose up -d --build후curl -s http://localhost/health200 확인docker logs robosense-nginx에 upstream connect 에러 없는지 확인