Certbot 不创建 acme-challenge 文件夹



几个月前我有工作让我们加密证书(使用旧的letsencrypt client)。我正在使用的服务器是nginx。

Certbot 正在创建 .well-known 文件夹,但不是 acme-challenge 文件夹

现在我尝试通过~/certbot-auto certonly --webroot -w /var/www/webroot -d domain.com -d www.domain.com -d git.domain.com创建新证书

但我总是收到这样的错误:

IMPORTANT NOTES:
   - The following errors were reported by the server:
   Domain: git.domain.com
   Type:   unauthorized
   Detail: Invalid response from
   http://git.domain.com/.well-known/acme-challenge/ZLsZwCsBU5LQn6mnzDBaD6MHHlhV3FP7ozenxaw4fow:
   "<.!DOCTYPE html>
   <.html lang='en'>
   <.head prefix='og: http://ogp.me/ns#'>
   <.meta charset='utf-8'>
   <.meta content='IE=edge' http-equiv"
   Domain: www.domain.com
   Type:   unauthorized
   Detail: Invalid response from
   http://www.domain.com/.well-known/acme-challenge/7vHwDXstyiY0wgECcR5zuS2jE57m8I3utszEkwj_mWw:
   "<.html>
   <.head><.title>404 Not Found</title></head>
   <.body bgcolor="white">
   <.center><.h1>404 Not Found</h1></center>

(当然,HTML标签中的点并不真正存在)

我一直在寻找解决方案,但还没有找到。有谁知道为什么 certbot 不创建文件夹?

提前感谢!

问题是nginx配置。我用最简单的配置替换了我的长配置文件:

server {
    listen 80;
    server_name domain.com www.domain.com git.domain.com;
    root /var/www/domain/;
}

然后我能够颁发新证书。

我的长配置文件的问题(据我所知)我有以下几行:

location ~ /.well-known {
    allow all;
}

但它们应该是:

location ~ /.well-known/acme-challenge/ {
    allow all;
}

现在更新也有效。

我也有类似的问题。我的问题是,我有这个规则:

 location ~ /. {
    access_log off;
    log_not_found off;
    deny all;
 }

取消每次访问以"."(点)

由于某种奇怪的原因(我认为 certbot 脚本以某种方式发生了变化),我无法以任何方式续订证书。经过近 4 个小时的研究,我终于找到了这个线程:

https://community.letsencrypt.org/t/solved-invalid-response-403-forbidden/64170/13

希望它能帮助别人。

诀窍是在 apache 配置中添加它:

DocumentRoot /var/lib/letsencrypt/http_challenges
    <Directory /var/lib/letsencrypt/http_challenges>
            Allow from All
    </Directory>

希望它对其他人有用!

最新更新