Let's Encrypt 갱신은 항상 어려운 것 같습니다.
갱신 관련 폴더는 /etc/letsencrypt/renewal 에 위치해 있습니다.
cd /etc/letsencrypt/renewal
sudo nano domain.com.conf
ubuntu@second-vv:/etc/letsencrypt/renewal$ sudo nano domain.com.conf
여기에 webroot가 있다.
# renew_before_expiry = 30 days
version = 1.21.0
archive_dir = /etc/letsencrypt/archive/domain.com
cert = /etc/letsencrypt/live/domain.com/cert.pem
privkey = /etc/letsencrypt/live/domain.com/privkey.pem
chain = /etc/letsencrypt/live/domain.com/chain.pem
fullchain = /etc/letsencrypt/live/domain.com/fullchain.pem
# Options used in the renewal process
[renewalparams]
account = d979d9160b20ea87c05850ce4ed7b29c
authenticator = webroot
webroot_path = /var/www/wordpress,
server = https://acme-v02.api.letsencrypt.org/directory
[[webroot_map]]
domain.com = /var/www/wordpress
sudo nano /etc/nginx/sites-available/default
nginx 설정은 아래와 같이 진행합니다.
upstream php-handler {
server 127.0.0.1:9000;
}
server {
listen 443 ssl http2;
server_name domain.com;
#루트 설정
root /var/www/wordpress;
#인덱스 설정
#charset utf-8;
index index.php index.htm index.nginx-debian.html index.html;
# SSL 인증서 설정
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
location / {
try_files $uri $uri/ /index.php?$args;
}
error_page 404 /404.html;
# PHP-FPM 연동 설정
location ~ \.php$ {
fastcgi_pass php-handler;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
server {
listen 443 ssl http2 default;
server_name www.domain.com;
location / {
return 301 https://domain.com$request_uri;
expires epoch;
}
# SSL 인증서 설정
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
}
server {
listen 80 default;
server_name domain.com www.domain.com;
include /etc/nginx/snippets/letsencrypt.conf;
location / {
return 301 https://domain.com$request_uri;
expires epoch;
}
}
webroot를 포기하고 nginx로 발급하니 되더라구요..
하 세상
'IT Trend' 카테고리의 다른 글
ZOOM 클라우드 저장공간 추가 알림 (0) | 2023.04.06 |
---|---|
북한 해킹 프로그램 INISAFE EX 위험 (0) | 2023.03.31 |
Docker로 Nextcloud 설치하기 (0) | 2023.01.21 |
과기부 메타버스 윤리원칙 확립 (0) | 2022.11.29 |
CloudFlare 네임서버와 도메인 연결하기 (0) | 2022.10.06 |