nginx 无法使用 Laravel Forge 颁发 letsencrypt ssl 证书

nginx Unable to issue letsencrypt ssl certificate with Laravel Forge

我在 nginx 中使用 Laravel Forge 部署了一个 Laravel 项目。 这个应用程序有几个别名。 我正在尝试为每个别名颁发 ssl 证书,但出现以下错误:

ERROR: Challenge is invalid! (returned: invalid) (result: ["type"]  "http-01"
["status"]  "invalid"
["error","type"]    "urn:ietf:params:acme:error:unauthorized"
["error","detail"]  "Invalid response from example.com/.well-known/acme-challenge/xxxxxxxxxxxxxxx [xxx.xx.xxx.xx]: \"\u003c!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional//EN\\" \\"DTD/xhtml1-transitional.dtd\\"\u003e\n\u003chtml xmlns=\\"http://www.w3.org/199\""
["error","status"]  403
["error"]   {"type":"urn:ietf:params:acme:error:unauthorized","detail":"Invalid response from example.com/.well-known/acme-challenge/xxxxxxxxxxxxxxx [xxx.xx.xxx.xx]: \"\u003c!DOCTYPE html PUBLIC \\"-//W3C//DTD XHTML 1.0 Transitional//EN\\" \\"DTD/xhtml1-transitional.dtd\\"\u003e\n\u003chtml xmlns=\\"http://www.w3.org/199\"","status":403}
["url"] "https://acme-v02.api.letsencrypt.org/acme/chall-v3/xxxxxxx/xxxxxx"
["token"]   "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
["validationRecord",0,"url"]    "example.com/.well-known/acme-challenge/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
["validationRecord",0,"hostname"]   "example.com"
["validationRecord",0,"port"]   "80"
["validationRecord",0,"addressesResolved",0]    "xxx.xx.xxx.xx"
["validationRecord",0,"addressesResolved"]  ["xxx.xx.xxx.xx"]
["validationRecord",0,"addressUsed"]    "xxx.xx.xxx.xx"
["validationRecord",0]  {"url":"example.com/.well-known/acme-challenge/xxxxxxxxxxxxxxx","hostname":"example.com","port":"80","addressesResolved": 
["xxx.xx.xxx.xx"],"addressUsed":"xxx.xx.xxx.xx"}
["validationRecord"]    [{"url":"example.com/.well-known/acme-challenge/xxxxxxxxxxxxxxxxxx","hostname":"example.com","port":"80","addressesResolved":["xxx.xx.xxx.xx"],"addressUsed":"xxx.xx.xxx.xx"}])

在此先感谢您的帮助。

Let's encrypt 说必须通过http(端口80)发送请求,但不能这样做。 试试这个: 转到底部的 larave Forge 站点页面,并以这种方式编辑 nginx 配置文件:

listen: 80
listen:[::] 80

保存并重试颁发证书。

请记住,在此之后,您必须修改配置以允许 https 通信。

对我有用。