Certbot 인증서 갱신 실패

certbot SSL 갱신에 문제가 있습니다. /etc/nginx/sites-available/ 아래에 여러 사이트가 있습니다.

.well-known 디렉토리를 위한 location 블록은 다음과 같습니다.

location ~ /\.well-known {
    auth_basic off;
    root /etc/letsencrypt;
    allow all;
}

그리고 각 사이트의 갱신 설정은 /etc/letsencrypt/renewal 디렉토리에 있습니다.
아래는 그 중 하나의 예시입니다.

#renew_before_expiry = 30 days
version = 2.7.4
archive_dir = /etc/letsencrypt/archive/redacted.com
cert = /etc/letsencrypt/live/redacted.com/cert.pem
privkey = /etc/letsencrypt/live/redacted.com/privkey.pem
chain = /etc/letsencrypt/live/redacted.com/chain.pem
fullchain = /etc/letsencrypt/live/redacted.com/fullchain.pem

#Options used in the renewal process
[renewalparams]
allow_subset_of_names = True
account = 670273d7a9a89f2d3494cf6e38739b1c
rsa_key_size = 4096
post_hook = /bin/systemctl reload nginx
authenticator = webroot
webroot_path = /etc/letsencrypt,
server = https://acme-v02.api.letsencrypt.org/directory
key_type = rsa
[[webroot_map]]
redacted.com = /etc/letsencrypt

현재 certbot 버전은 2.7.4이며, 1.32.0에서 업그레이드했지만 여전히 작동하지 않았습니다.

문제가 ip6tables와 관련되어 있다는 것은 알고 있지만, 이미 443 포트와 80 포트에 대한 ACCEPT 규칙이 설정되어 있습니다.

certbot renew --dry-run 실행 중에 acme-challenge 파일에 접근을 시도하면 파일에 성공적으로 접근할 수 있습니다. 따라서 80 및 443 포트는 문제가 아닐 것입니다.

ip6tables INPUT 필터를 DROP에서 ACCEPT로 변경하면 모든 사이트가 갱신되지만, INPUT DROP 필터를 사용하면 대부분의 사이트가 다음 오류와 함께 갱신에 실패합니다.

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: redacted.com
Type: connection
Detail: xxx.xxx.xxx.xxx: Fetching https://redacted.com/.well-known/acme-challenge/EIJFF3UFqtZJCZtG_Kv9Ca7BGA5LiuBdb9JIWxXIhVg: Timeout during connect (likely firewall problem)

이미 최소한의 규칙 세트로 시도해 보고, input 체인 상단에 80 및 443 포트 ACCEPT 규칙을 추가해 보았지만 역시 작동하지 않았습니다. 그래서 현재 막혀 있는 상태입니다.

예시 nginx 설정은 아래 줄에서 찾을 수 있습니다.

server {
    listen [::]:80;
    server_name .redacted.com;
    return 301 https://redacted.com$request_uri;
}

server {
    listen [::]:443 ssl http2;
    server_name redacted.com;
    access_log /var/www/log/access/redacted.access.log main buffer=32k;
    error_log /var/www/log/error/redacted.com.error.log notice;
    limit_conn gulag 200;
    root /var/www/web/redacted.com/web;
    index index.php;

    ssl_certificate /etc/letsencrypt/live/redacted.com/fullchain.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/redacted.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/redacted.com/privkey.pem;
    include ssl_params;

    ## Standard site protection
    include		snippets/standard.conf;

    location ~ /\.well-known {
        auth_basic off;
        root /etc/letsencrypt;
        allow all;
    }

    ## Deny illegal Host headers
    if ($host !~* ^(redacted.com|redacted.com)$ ) {
        return 444;
        break;
    }

    ## Drupal configuration
    include snippets/drupal7-php7.4.conf;

    ## php handling
    include snippets/php7.4.conf;
}

참고로, certbot 갱신 중에 acme 파일에 대한 HTTP 200 코드가 nginx 로그에서 확인됩니다.

nginx 또는 Let’s Encrypt 포럼에서 더 좋은 도움을 받으실 수 있을 것 같습니다. 이 질문은 실제로는 Discourse와 관련이 없습니다.