Caddy auto https error, 404 Timeout after connect (your server may be slow or overloaded)

My domain is:

I can login to a root shell on my machine (yes or no, or I don't know):

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

My project is containerized along side caddy (version 2.2.1-alpine) and is orchestrated with docker swarm. It is running on a remote server from linode, using the docker app from the marketplace which runs debain 9. When I issue the docker deploy command, everything is working. However, inspecting the logs of caddy shows that it is not able to complete any of the challenges ([](https://Link to full error log form docker service logs).

From inside of my remote server, I have tried to curl different letsencrypt urls and all of them are functional. From outside the server, I am able to see that both port 80 and 443 are open (When I am running my server) when I run nmap or nmap

Starting Nmap 7.80 ( ) at 2020-11-13 12:03 AEDT
Nmap scan report for (
Host is up (0.027s latency).
Not shown: 997 closed ports
22/tcp  open  ssh
80/tcp  open  http
443/tcp open  https

So to me it seems that both ports are reachable from outside of the server and lets encrypt should be able to reach it. Lets debug results of my my domain name however, shows that AAAA and A are not working through either port.

When I checked my DNA and AAAA records on mxtoolbook it also showed the corrects ip address, so it seems that my A/AAAA records are functional. So I am lost as to why caddy cant issue the certificates. And why letsencrypt cant reach my sever.


Your nmap test is obviously coming from a trusted network:

curl -Iki
curl: (7) Failed to connect to port 80: Connection refused
1 Like

Additional tidbit:

Addresses:  2400:8907::f03c:92ff:fe15:b193

curl -Iki [2400:8907::f03c:92ff:fe15:b193]
curl: (7) Failed to connect to 2400:8907::f03c:92ff:fe15:b193 port 80: Connection refused

Its probably just due to the fact that caddy is spun down. If you try again it should show both ports open.
And if it is due to me using a trusted network, what can I do to allow untrusted networks to access my sever. As ufw on my linode has default of allowing all incoming and outgoing.


But still a problem:

curl -6Iki
HTTP/1.1 403 Forbidden
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: frame-ancestors 'self'
Content-Type: text/html; charset="utf-8"
Content-Length: 2969
Connection: Close

curl -4Iki
HTTP/1.1 308 Permanent Redirect
Connection: close
Server: Caddy
Date: Fri, 13 Nov 2020 04:01:47 GMT

As LE prefers IPv6 when present, that will cause this to fail.
Remove IPv6 or test/correct the IPv6 address.


Well you don't see that every day.


It's the last chance warning.
If I have to tell you again...
Stop knocking on my door - that guy doesn't live here anymore!


Im pretty sure its a configuration in my caddyfile, do redirect to https.


Removing the AAAA records from linodes dns manager fixed the problem. Im curious though I let linode auto fill the ipv6 and added it to etc/hosts like the ipv4, so why would it cause issues?


It's a 308 though instead of the usual 301. Nothing wrong with it (unless you want to change the HTTP request type).


The IPv6 wasn't being handled properly by the web service.


308 was a red herring.
The 403 on IPv6 was the problem.


The 308 was never a problem. Just a curious observation.

308 Permanent Redirect (RFC 7538)

The request and all future requests should be repeated using another URI. 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change. So, for example, submitting a form to a permanently redirected resource may continue smoothly.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.