한동안 nocta 사이트를 안들어가봤다가 최근에 한 번 들어가보니까 갑자기 HTTPS 연결이 사용되지 않고 있다는 것이다!
이 문제의 원인을 분석하면서 찾은 인증서와 관련한 모든 문제를 해결하고자 한다
nocta.site
)에 HTTPS 연결(자물쇠 표시)이 전혀 적용되지 않고, 브라우저에서 “보안 연결 사용 안 함” 경고 발생로그 정보
실행 명령어
cat /var/log/letsencrypt/letsencrypt.log
분석 결과
크론 실행 타임스탬프 확인
2025‑07‑20 04:34:19,…
2025‑07‑20 17:41:27,…
2025‑07‑21 03:57:03,…
…
2025‑07‑24 14:32:27,…
certbot renew
가 호출된 로그가 남아 있다
갱신 동작 분석
Processing /etc/letsencrypt/renewal/nocta.site.conf
…
Certificate not yet due for renewal
The following certificates are not due for renewal yet:
/etc/letsencrypt/live/nocta.site/fullchain.pem expires on 2025-09-20 (skipped)
No renewals were attempted.
/etc/letsencrypt/live/nocta.site/fullchain.pem
의 만료일이 2025‑09‑20 로 아직 30일 이내가 아니므로 Certbot은 기본 정책(-renew-before 30 days
)에 따라 갱신을 건너뜀분석 결과
/.well-known/acme-challenge/...
)에 대한 접근 시도와 결과docker logs refactor-web33-nocta-nginx-1 | grep -i ssl
1. ACME 챌린지 파일 미응답 (404)
증상
2025/06/14 21:43:54 [error] … open() "/var/www/certbot/.well-known/acme-challenge/index.php" failed (2: No such file or directory)
…
2025/06/15 19:14:14 [error] … "/var/www/certbot/.well-known/acme-challenge/index.html" is not found (2: No such file or directory)
…
(매일 수십 건)
2025/07/20 11:49:34 [error] … "/var/www/certbot/.well-known/acme-challenge/index.html" is not found …
2025/07/21 00:34:19 [error] … open() "/var/www/certbot/.well-known/acme-challenge/cloud.php" failed …
/var/www/certbot
하위 .well-known/acme-challenge/…
경로에 챌린지 파일이 전혀 만들어지지 않아서 Let’s Encrypt 서버가 HTTP‑01 검증을 시도할 때마다 404를 리턴
~/certbot/www:/var/www/certbot
마운트가 제대로 됐으면 토큰 생성 시점에 잠깐이라도 파일이 보였어야 하는데, 로그에는 한 번도 “Serving challenge…” 같은 성공적인 응답이 보이지 않습니다.원인
~/certbot/www
는 셸 확장(틸드 해석) 이 되지 않으므로, 실제 호스트의 /home/ubuntu/certbot/www
디렉토리가 컨테이너에 마운트되지 않고 있다2. SSL/TLS “record layer failure” (간헐적)
2025/06/27 00:12:21 [crit] … SSL_read() failed (SSL: … decryption failed or bad record mac …)
…
Compose YAML 내부의 ~/certbot/www
는 셸 확장(틸드 해석) 이 되지 않으므로, 절대 경로를 사용한다
volumes:
- ~/certbot/www:/var/www/certbot
volumes:
- /home/ubuntu/certbot/www:/var/www/certbot:ro