let's Encrypt 갱신 오류

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로 발급하니 되더라구요..

 

하 세상