/엔지니어/네트워킹 / 서버/Let's Encrypt로 HTTPS 무료 SSL
네트워킹 / 서버초급ubuntucentosdebiansslhttpsletsencrypt

Let's Encrypt로 HTTPS 무료 SSL 인증서 발급

Certbot을 사용해 도메인에 무료 SSL 인증서를 발급하고 Nginx에 적용, 자동 갱신을 설정하는 방법입니다.

사전 조건

  • 도메인 A 레코드가 서버 IP를 가리키고 있어야 함
  • 포트 80, 443 열려 있어야 함

Certbot 설치

Bash
sudo apt install -y certbot python3-certbot-nginx

인증서 발급

Bash
sudo certbot --nginx -d example.com -d www.example.com

certbot이 자동으로 Nginx 설정에 SSL 블록과 HTTP → HTTPS 리다이렉트를 추가합니다.


수동 Nginx 설정

Bash
sudo certbot certonly --nginx -d example.com
Nginx
server {
    listen 443 ssl http2;
    server_name example.com;

    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
    ssl_prefer_server_ciphers off;
    ssl_session_cache shared:SSL:10m;
    ssl_stapling on;
    ssl_stapling_verify on;

    location / {
        proxy_pass http://127.0.0.1:3000;
    }
}

server {
    listen 80;
    server_name example.com;
    return 301 https://$host$request_uri;
}

자동 갱신 (90일 유효기간)

Bash
systemctl status certbot.timer
sudo certbot renew --dry-run

와일드카드 인증서

Bash
sudo certbot certonly \
  --manual \
  --preferred-challenges dns \
  -d "*.example.com" \
  -d example.com
#ssl#https#letsencrypt#certbot#nginx#tls
편집 안내 · Editorial Note

이 가이드는 AI 도구를 활용해 초안을 구성하고 사람이 명령어·문맥을 검토해 발행했습니다. 운영체제와 도구 버전에 따라 결과가 달라질 수 있으므로 적용 전 공식 문서를 함께 확인하세요. 오류를 발견하시면 이메일로 제보해 주세요.

질문 & 답변 (Q&A)

이 가이드에 대해 궁금한 점을 질문해보세요. 확인 후 답변드립니다.