1. Caddy version (caddy version
):
Not sure which exact version, but I know it’s Caddy 1.x running inside a docker container (if someone can tell me how to get the version from the container I’ll go get it)
2. How I run Caddy:
a. System environment:
Ubuntu 14.04, running inside a Docker container
b. Command:
docker start caddy
c. Service/unit/compose file:
Using the abiosoft/caddy image (old version as I haven’t updated in a long time)
d. My complete Caddyfile or JSON config:
blog.rooday.com {
gzip
proxy / 172.17.0.2:2368 {
transparent
}
}
smmry.rooday.com {
gzip
proxy / 127.0.0.1:8080 {
transparent
}
}
3. The problem I’m having:
So I have caddy 1.x running inside a docker container, and I have a ghost blog running in a docker container (the blog subdomain). So far they have been working together just fine. I recently added a new project to this server, a node.js/express.js server that’s running under PM2, exposed on port 8080. I want to reverse proxy smmry.rooday.com to this express.js server, but it keeps failing the letsencrypt step to setup SSL and I’m not sure what else I need to do. Here’s my server code:
const express = require("express");
const bodyParser = require("body-parser");
const favicon = require("serve-favicon");
const path = require("path");
const app = express();
const axios = require("axios");
const qs = require("qs");
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, "build")));
app.use(favicon(path.join(__dirname, "build", "favicon.ico")));
app.post("/smmry", (req, res) => {
if (req.body.url) {
axios
.get(
`https://api.smmry.com/&SM_API_KEY=${req.body.apiKey}&SM_LENGTH=${req.body.lines}&SM_WITH_BREAK&SM_URL=${req.body.url}`
)
.then((smmry) => res.json(smmry.data));
} else {
axios
.post(
`https://api.smmry.com/&SM_API_KEY=${req.body.apiKey}&SM_LENGTH=${req.body.lines}&SM_WITH_BREAK`,
qs.stringify({
sm_api_input: req.body.text,
}),
{
headers: {
Expect: "100-continue",
"Content-Type": "application/x-www-form-urlencoded",
},
}
)
.then((smmry) => res.json(smmry.data));
}
});
app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, "build", "index.html"));
});
const port = process.env.PORT || 8080;
app.listen(port, () => {
console.log(`Listening on port ${port}`);
});
4. Error messages and/or full log output:
Activating privacy features... 2020/11/14 23:48:10 [INFO][smmry.rooday.com] acme: Obtaining bundled SAN certificate
2020/11/14 23:48:10 [smmry.rooday.com] failed to obtain certificate: acme: Error 429 - urn:ietf:params:acme:error:rateLimited - Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/
exit status 1
Activating privacy features... 2020/11/14 23:48:14 [INFO][smmry.rooday.com] acme: Obtaining bundled SAN certificate
2020/11/14 23:48:14 [smmry.rooday.com] failed to obtain certificate: acme: Error 429 - urn:ietf:params:acme:error:rateLimited - Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/
exit status 1
Activating privacy features... 2020/11/14 23:48:21 [INFO][smmry.rooday.com] acme: Obtaining bundled SAN certificate
2020/11/14 23:48:21 [smmry.rooday.com] failed to obtain certificate: acme: Error 429 - urn:ietf:params:acme:error:rateLimited - Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/
exit status 1
Activating privacy features... 2020/11/14 23:48:34 [INFO][smmry.rooday.com] acme: Obtaining bundled SAN certificate
2020/11/14 23:48:34 [smmry.rooday.com] failed to obtain certificate: acme: Error 429 - urn:ietf:params:acme:error:rateLimited - Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/
exit status 1
5. What I already tried:
At first I thought the issue was that I ran caddy before my DNS for smmry.rooday.com (cloudflare) finished propagating, so I waited a few hours and came back. When I do nslookup I can confirm that the DNS is cloudflare (it’s the same IP for blog.rooday.com), so the domain is definitely live. I feel like the issue has to do with caddy being inside docker and my server being run as a system process with PM2 (this would explain why the blog works since it’s also under docker). Does anyone know how to get caddy to work in this scenario?