반응형
우분투 환경에 Nginx를 설치하고 서비스에 인증서 세팅하는 방법을 정리한다.
작성일 : 2023-12-20
OS : Ubuntu 22.04 LTS
Nginx : 1.18.0
<1> apt update & upgrade
sudo apt update
sudo apt upgrade
<2> 이전버전 삭제
sudo apt remove nginx
<3> nginx 설치
sudo apt install nginx
<4> certbot 설치
Certbot은 HTTPS를 활성화하기 위해 수동으로 관리되는 웹사이트에서 Let’s Encrypt 인증서를 자동으로 사용하는 무료 오픈 소스 소프트웨어 도구입니다.
Certbot - Link
Let's Encrypt - Link
sudo apt install certbot
sudo apt install python3-certbot-nginx
<5> proxy 설정
server {
listen 80;
server_name {도메인};
location / {
proxy_pass http://{target IP};
proxy_set_header Host {도메인};
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
<6> 인증서 설치
# 최초설치
certbot
# 갱신
certbot renew
<7> 인증서 자동갱신 설정
crontab -e
----------------------------------------
0 12 * * * /usr/bin/certbot renew --quiet
반응형
'Setting' 카테고리의 다른 글
[Setting | MacOS] Ruby Version Update (0) | 2025.01.23 |
---|---|
[Setting | MacOS] HomeBrew(MacOS 패키지 관리자) 설치 (0) | 2025.01.23 |
[Setting | Ubuntu] CI / CD 환경 구축하기 (3) (0) | 2025.01.01 |
[Setting | Ubuntu] CI / CD 환경 구축하기 (2) (0) | 2024.12.27 |
[Setting | Ubuntu] CI / CD 환경 구축하기 (1) (0) | 2024.12.26 |