노트북으로 홈서버 구축하기 - certbot --expand로 SSL 서브도메인 추가하기 (9편)

문제 상황 처음 SSL 인증서를 발급할 때 메인 도메인만 포함해서 발급했다. certbot certonly --nginx -d yourdomain.com 이후 서비스가 하나씩 늘어나면서 서브도메인이 추가됐는데, 브라우저에서 photo.yourdomain.com에 접속하면 아래 에러가 발생했다. NET::ERR_CERT_COMMON_NAME_INVALID 연결이 비공개로 설정되어 있지 않습니다. 인증서에 photo.yourdomain.com이 포함돼 있지 않아서 생기는 문제였다. 해결: –expand 옵션 기존 인증서에 서브도메인을 추가할 때는 --expand 플래그를 써야 한다. --expand 없이 서브도메인을 추가하려고 하면 아래 에러가 난다. Missing command line flag or config entry for this setting: You have an existing certificate that contains a portion of the domains you requested. It contains these names: yourdomain.com You requested these names for the new certificate: yourdomain.com, photo.yourdomain.com Do you want to expand and replace this existing certificate with the new certificate? (You can set this with the --expand flag) certbot이 친절하게 --expand 쓰라고 안내해주긴 한다. ...

March 31, 2026 · 2 min · 363 words · Chanyeol
1