feat(infra): HTTPS(TLS) 스캐폴딩 + 프록시 헤더 처리

- Spring prod: server.forward-headers-strategy=framework — nginx의 X-Forwarded-Proto를
  신뢰해 프록시 뒤에서도 request.isSecure()=true → Secure 쿠키·https 리다이렉트 정상화.
- frontend/nginx-tls.conf: 443 TLS 종료 + 80→443 리다이렉트(+ /api 프록시).
- infra/docker-compose.tls.yml: base와 함께 쓰는 HTTPS 오버레이(443 매핑·인증서 볼륨·
  ACS_PUBLIC_BASE_URL/ACS_COOKIE_SECURE). infra/certs/.gitignore로 인증서·키 커밋 제외.
- README: HTTPS 적용 절차(인증서 준비→.env→compose 오버레이) 갱신.

검증: forward-headers=framework + cookie.secure=true로 기동 후 X-Forwarded-Proto=https 유무 대조 —
헤더 있으면 XSRF-TOKEN·JSESSIONID 모두 Secure, 없으면 XSRF Secure 미부여(프록시 프로토콜 연동 확인).
자체서명 인증서 생성 확인. 전체 컨테이너 TLS e2e는 Docker 데몬 기동 시 별도 검증 필요.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
unknown
2026-07-03 16:12:14 +09:00
parent 17d6036bca
commit d8ba443b35
5 changed files with 93 additions and 6 deletions

View File

@@ -1,6 +1,11 @@
spring.application.name=acs
server.port=8080
# ===== Reverse proxy (nginx terminates TLS) =====
# Honor X-Forwarded-Proto/For from the nginx front so request.isSecure() is true behind
# TLS termination — makes the CSRF XSRF-TOKEN cookie Secure and redirects use https.
server.forward-headers-strategy=framework
# ===== Session cookie hardening =====
# SameSite=Lax complements the CSRF token defense.
# Secure=true means the cookie is only sent over HTTPS — enable it (ACS_COOKIE_SECURE=true)