wordpress - NGinx/wordpress - Letsencrypt 无法创建证书
问题描述
我正在尝试使用letsencrypt为我的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 文件没问题(我用 a 检查过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
有人对此有任何线索吗?
提前致谢。
解决方案
好的,所以我终于找到了问题的根源:我的启用站点的文件夹中有一个 mywebsite.conf~ 文件和一个 mywebsite.conf 文件。删除 mywebsite.conf~ 解决了我的问题。
推荐阅读
- asp.net-core - 部署时不提供 Nuget 包内容文件
- angular - 使用传递的函数引用调用方法时未定义的 Angular DI 变量
- r - 在 dplyr 组内应用函数
- vuejs2 - 我可以在 vuex 3 中使用 2 个参数调度动作吗?
- android - 画布:试图绘制太大(151099200字节)位图
- json - 如何使用 Moshi 将 json 字符串序列化为 org.json.JSONObject?
- ssl - TLS 握手失败并出现错误 tls:第一条记录看起来不像 TLS 握手服务器=Orderer remoteaddress=192.168.144.4:43496
- jquery - 用于数据表的 Ajax 源数据
- c# - 通过 32feet.Net 库连接蓝牙设备
- php - 如何在 Laradock 中安装 Mosquitto-php