Let's Encrypt를 이용한 HTTPS 설정 | Nginx Https SSL | JMON

JMON·2021년 1월 20일
1

Ubuntu

목록 보기
3/3
post-thumbnail

📄 설명

📣 Let's Encrypt

Let's Encrypt는 보안 웹사이트를 위한 인증서의 수동 생성, 유효성 확인, 디지털 서명, 설치, 갱신 등 종전의 복잡한 과정을 없애주는 자동화된 프로세스를 통해 전송 계층 보안 암호화를 위해 무료 X.509 인증서를 제공하는 인증 기관이다.

📄 사용방법

📣 설치

✍ 코드

apt-get update -y
# 업데이트
apt-get install software-properties-common
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt-get update -y
# 설치 준비

apt-get install certbot python3-certbot-nginx
# 설치

📣 설정

✍ NGINX 설정 파일

# vi /etc/nginx/sites-available/{실행 파일}

...
server {
  listen      80;
  listen [::]:80;

  server_name undang.twpower.me;
  charset     utf-8;

  client_max_body_size 75M;   # adjust to taste
...

✍ NGINX 재실행

nginx -t
# 테스트
service nginx reload
systemctl restart nginx
# 위 재실행 방법이 동작하지 않는 경우

📣 SSL 인증 획득

✍ 실행

certbot --nginx -d {도메인명1} -d {도메인명2}

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
# 리다이렉트 설정

📣 인증서 자동갱신

✍ 설정

certbot renew --dry-run

📄 참고자료

🎈 Document : https://letsencrypt.org/ko/docs/

profile
Fullstack Developer

0개의 댓글