【发布时间】:2020-01-10 19:21:21
【问题描述】:
我在README file examples 之后设置了一个基于redbird 的代理。
到目前为止,我已经为 http 和 https 配置了单个域,并且运行良好(https 仍然使用自签名证书)。
但现在我正在尝试将其配置为使用letsencrypt自动获取有效的ssl证书,但我陷入了以下错误:
{"level":30,"time":1578681102208,"pid":21320,"hostname":"nigul","name":"redbird","0":false,"1":"setChallenge called for 'exposito.bitifet.net'","msg":"Lets encrypt debugger","v":1}
[acme-v2] handled(?) rejection as errback:
Error: Error: Failed HTTP-01 Pre-Flight / Dry Run.
curl 'http://exposito.bitifet.net/.well-known/acme-challenge/test-cf55199519d859042f695e620cca8dbb-0'
Expected: 'test-cf55199519d859042f695e620cca8dbb-0.MgLl7GIS59DPtPMejuUcXfddzNt8YxfLVo5op670u8M'
Got: '<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
</body>
</html>
'
See https://git.coolaj86.com/coolaj86/acme-v2.js/issues/4
at /home/joanmi/SERVICES/redbird_domains/node_modules/acme-v2/index.js:49:10
at process._tickCallback (internal/process/next_tick.js:68:7)
据我了解,这告诉我 Lets Encrypt 正在尝试使用以下命令访问 url http://exposito.bitifet.net/.well-known/acme-challenge/test-cf55199519d859042f695e620cca8dbb-0:
curl 'http://exposito.bitifet.net/.well-known/acme-challenge/test-cf55199519d859042f695e620cca8dbb-0'
...它似乎是一个 404 HTML 错误页面,我不知道它会出现在哪里。
事实上,执行那个 curl 命令或者只是在我的浏览器中粘贴 that url(你可以试试:我让服务器运行),我得到了给定的 Expected 字符串所以,从我的角度来看,如果我的配置是正确的,但由于某种原因,Lets Encrypt 的服务器正在访问另一台服务器(因为路由或 DNS 错误)。
但另一方面,我想更有可能是我在配置中做错了什么。
在这里我粘贴我的整个脚本(端口 80 和 443 分别通过 iptables 重定向到 1080 和 1443,因为该脚本是由非特权用户运行的):
const Redbird = require("redbird");
const proxy = Redbird({
port: 1080,
xfwd: false, // Disable the X-Forwarded-For header
letsencrypt: {
path: __dirname + '/certs',
port: 9999
// LetsEncrypt minimal web server port for handling challenges.
// Routed 80->9999, no need to open 9999 in firewall. Default 3000
// if not defined.
},
ssl: {
http2: true,
port: 1443, // SSL port used to serve registered https routes with LetsEncrypt certificate.
}
});
proxy.register('exposito.bitifet.net:9999', 'http://localhost:8001', {
ssl: {
letsencrypt: {
email: 'xxxxxx@gmail.com', // Domain owner/admin email
production: false,
// WARNING: Only use this flag when the proxy is verified to
// work correctly to avoid being banned!
}
}
});
proxy.register("exposito.bitifet.net", "http://localhost:8001");
欢迎提供任何线索。
谢谢。
【问题讨论】:
标签: lets-encrypt redbird