1. Caddy version (caddy version
):
Caddy version v2.2.1
2. How I run Caddy:
Docker on portainer
a. System environment:
Ubuntu 20.04.1 LTS
b. Command:
c. Service/unit/compose file:
Docker version 19.03.8
d. My complete Caddyfile or JSON config:
{
email [MYEMAIL]
}
[MYDOMAIN], [MYDOMAIN]
{
root * /var/www
file_server
}
portainer.[MYDOMAIN]
{
reverse_proxy localhost:9000
}
nextcloud.[MYDOMAIN]
{
reverse_proxy localhost:8080
}
3. The problem I’m having:
I have set 3 A domain in Server Zone DNS
[MYDOMAIN]
www.[MYDOMAIN]
portainer.[MYDOMAIN]
nexcloud.[MYDOMAIN]
All pointing to [MYIP]
I can reach [MYDOMAIN] and www.[MYDOMAIN] on browser but
portainer.[MYDOMAIN] and nextcloud.[MYDOMAIN] give me HTTP ERROR 502
4. Error messages and/or full log output:
{“level”:“error”,“ts”:1604688101.0248196,“logger”:“http.log.error”,“msg”:“dial tcp 127.0.0.1:8080: connect: connection refused”,“request”:{“remote_addr”:“47.53.143.134:49194”,“proto”:“HTTP/2.0”,“method”:“GET”,“host”:“nextcloud.[MYDOMAIN]”,“uri”:"/",“headers”:{“Cache-Control”:[“max-age=0”],“User-Agent”:[“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Sec-Fetch-Site”:[“cross-site”],“Sec-Fetch-Dest”:[“document”],“Accept-Encoding”:[“gzip, deflate, br”],“Accept-Language”:[“it-IT,it;q=0.9”],“Upgrade-Insecure-Requests”:[“1”],“Sec-Fetch-Mode”:[“navigate”],“Sec-Fetch-User”:["?1"]},“tls”:{“resumed”:false,“version”:772,“cipher_suite”:4865,“proto”:“h2”,“proto_mutual”:true,“server_name”:“nextcloud.[MYDOMAIN]”}},“duration”:0.000933191,“status”:502,“err_id”:“n7s1hyaun”,“err_trace”:“reverseproxy.(*Handler).ServeHTTP (reverseproxy.go:441)”}