FLYNNLABAboutMeCodingActivityStudy 2024초등수학
Let's Encrypt Wildcard
ssl, https, letsencrypt

HTTPS 인증서는 보안을 위해서는 필수이다.

Let's Encrypt를 사용하면 무료로 HTTPS 인증서를 발급받을 수 있다. 하지만 기본적으로는 도메인 단위로 인증서를 발급받을 수 있기 때문에 서브 도메인을 사용하는 경우에는 여러 개의 인증서를 발급받아야 한다.

다행이 와일드카드 인증서를 발급받을 수 있게 된지는 좀 되었다.

Let's Encrypt를 통해 SSL 인증서 발급받기

sudo apt install certbot
sudo certbot certonly --manual --preferred-challenges=dns --email youremail@email.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d yourdomain.com -d *.yourdomian.com
Please deploy a DNS TXT record under the name:

_acme-challenge.niceilm.net.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          with the following value:
[발급된 값]

발급된 값을 DNS에 TXT record 에 등록을 한다.

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/niceilm.net/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/niceilm.net/privkey.pem
This certificate expires on 2024-02-17.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

등록이 성공되면 인증서가 발급된 패스가 나온다. 이를 이용해서 nginx 설정을 하면 된다.