我正在尝试使用letencrypt为我的wordpress网站生成证书。我正在使用NGinx作为网络服务器。
我尝试了很多事情,但是一切似乎都失败了,而且我仍然收到相同的错误消息(我使用的命令是sudo certbot --nginx
,但我也尝试了:sudo certbot --nginx --d www.mywebsite.fr
):
Failed authorization procedure. mywebsite.fr (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://mywebsite.fr/.well-known/acme-challenge/q9Ck4GJMSTpqiJAQXUz47ShS544l40Kx1u3DN3mDa90 [51.158.126.54]: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: mywebsite.fr
Type: unauthorized
Detail: Invalid response from
http://mywebsite.fr/.well-known/acme-challenge/q9Ck4GJMSTpqiJAQXUz47ShS544l40Kx1u3DN3mDa90
[51.158.126.54]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
Not Found</h1></center>\r\n<hr><center>"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
我的DNS文件正常(我用nslookup
检查了)。
我尝试创建一个.well-known / acme-challenge目录,但这不能解决问题。
我还尝试了修改.htaccess文件,但是它也没有起作用。看起来像这样:
RewriteRule "^.well-known/acme-challenge" - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^\.well-known/.+ - [END]
# BEGIN WordPress
# Les directives (lignes) entre 'BEGIN WordPress' et 'END WordPress' sont
# généré dynamiquement, et ne doivent uniquement être modifiées via les filtres WordPress.
# Toute modification des directives entre ces marqueurs sera outrepassée.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /www/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /www/index.php [L]
</IfModule>
# END WordPress
有人对此有任何线索吗?
谢谢。
答案 0 :(得分:0)
好吧,所以我终于找到问题的根源:在启用站点的文件夹中有一个mywebsite.conf〜文件和一个mywebsite.conf文件。删除mywebsite.conf〜解决了我的问题。