为什么 certbot(letsencrypt)会收到 403 禁止代码?

为什么 certbot(letsencrypt)会收到 403 禁止代码?

尝试在 nginx 网络服务器上为我的域创建证书。运行 certbot 时,它会给出 403 未授权错误,因为它出于某种原因无法在域上看到该文件,但如果我复制该文件,我就可以从我的域中查看它。

正在运行的命令

certbot certonly --webroot -w /var/www/html/example.com/website/ -d www.example.com -d example.com 

收到的错误

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for www.example.com
http-01 challenge for example.com
Using the webroot path /var/www/html/example/website for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.example.com/.well-known/acme-challenge/lBNrwYPRz_0iFkXPGG2jfixRecA7VMMDOmYst_qzXCI: "<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>"

我确实知道 NGINX 需要某些位置块,但如果我重新创建这些文件,我就可以访问它们。(它会自动下载文件吗?)

www.example.com/.well-known/acme-challenge/lBNrwYPRz_0iFkXPGG2jfixRecA7VMMDOmYst_qzXCI

这是我的基本 NGINX 配置。

server {

    listen 80;
    listen [::]:80;

    server_name www.example.com example.com 167.0.0.0;
    root /var/www/html/example/website;
    index index.html index.php index;

    location /forums {
        root /var/www/html/example;
    }


}

相关内容