1. Output of caddy version
:
v2.6.1 h1:EDqo59TyYWhXQnfde93Mmv4FJfYe00dO60zMiEt+pzo=
2. How I run Caddy:
a. System environment:
Ubuntu 22, fresh install, all updates. ONLY caddy installed on top (so far)
b. Command:
caddy reload --config /home/caddy/Caddyfile
c. Service/unit/compose file:
Nope/nada
d. My complete Caddy config:
sp4.matice.com {
encode zstd gzip
respond "Hello!"
}
matice.com {
reverse_proxy https://216.108.230.119
}
myseconddomain.com {
reverse_proxy https://216.108.230.119
}
mythirddomain.com {
reverse_proxy https://216.108.230.119
}
3. The problem I’m having:
Objective is to have caddy sit in front of an existing webserver that already runs multiple sites, all on port 80/443 (80 redirects to 443 if necessary on that server). That server is running AAPanel to serve sites. Caddy loads fine, and the “http or https://sp4.matice.com” test works fine. Going to matice.com brings back a blank page. Same with any other domain I move to this IP and test. I have also tested using an internal ip address, forcing the :443 on the IP, removing https:// from front.
4. Error messages and/or full log output:
Sep 25 10:24:31 ashburn-va-datacenter.serverpoint.com caddy[50307]: {"level":"debug","ts":1664115871.5614827,"logger":"http.acme_client","msg":"http request","method":"POST","url":"https://acme.zerossl.com/v2/DV90/authz/deBFzjS1CRmJNaValUHMEQ","headers":{"Content-Type":["application/jose+json"],"User-Agent":["Caddy/2.6.1 CertMagic acmez (linux; amd64)"]},"response_headers":{"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=-1"],"Content-Length":["451"],"Content-Type":["application/json"],"Date":["Sun, 25 Sep 2022 14:24:31 GMT"],"Link":["<https://acme.zerossl.com/v2/DV90>;rel=\"index\""],"Replay-Nonce":["5nmHi-2p99GLVWsdqQ4L8owGosl2DB7MO9sLvZajW_w"],"Retry-After":["5"],"Server":["nginx"],"Strict-Transport-Security":["max-age=15552000"]},"status_code":200}
Sep 25 10:24:32 ashburn-va-datacenter.serverpoint.com caddy[50307]: {"level":"debug","ts":1664115872.4457216,"logger":"http.acme_client","msg":"http request","method":"POST","url":"https://acme.zerossl.com/v2/DV90/authz/smPwtDEq6427eEl13zbUaA","headers":{"Content-Type":["application/jose+json"],"User-Agent":["Caddy/2.6.1 CertMagic acmez (linux; amd64)"]},"response_headers":{"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=-1"],"Content-Length":["450"],"Content-Type":["application/json"],"Date":["Sun, 25 Sep 2022 14:24:32 GMT"],"Link":["<https://acme.zerossl.com/v2/DV90>;rel=\"index\""],"Replay-Nonce":["cyk491HRipR_StmSoV3LwG11JMZOTbEd5ILnQRNRlI0"],"Retry-After":["5"],"Server":["nginx"],"Strict-Transport-Security":["max-age=15552000"]},"status_code":200}
Sep 25 10:24:33 ashburn-va-datacenter.serverpoint.com caddy[50307]: {"level":"debug","ts":1664115873.2876794,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"216.108.230.199:443","duration":3.000317322,"request":{"remote_ip":"73.180.158.177","remote_port":"59635","proto":"HTTP/2.0","method":"GET","host":"matice.com","uri":"/","headers":{"Accept-Language":["en-US,en;q=0.5"],"X-Forwarded-Proto":["https"],"Te":["trailers"],"Sec-Fetch-Site":["none"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Upgrade-Insecure-Requests":["1"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Mode":["navigate"],"X-Forwarded-For":["73.180.158.177"],"Sec-Fetch-User":["?1"],"Cookie":[],"X-Forwarded-Host":["matice.com"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"],"Sec-Fetch-Dest":["document"]},"tls":{"resumed":true,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matice.com"}},"error":"dial tcp 216.108.230.199:443: i/o timeout"}
Sep 25 10:24:33 ashburn-va-datacenter.serverpoint.com caddy[50307]: {"level":"error","ts":1664115873.288417,"logger":"http.log.error","msg":"dial tcp 216.108.230.199:443: i/o timeout","request":{"remote_ip":"73.180.158.177","remote_port":"59635","proto":"HTTP/2.0","method":"GET","host":"matice.com","uri":"/","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Accept-Language":["en-US,en;q=0.5"],"Cookie":[],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"],"Te":["trailers"]},"tls":{"resumed":true,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matice.com"}},"duration":3.001553079,"status":502,"err_id":"ihqhvu7d3","err_trace":"reverseproxy.statusError (reverseproxy.go:1271)"}
Sep 25 10:24:33 ashburn-va-datacenter.serverpoint.com caddy[50307]: {"level":"debug","ts":1664115873.6374648,"logger":"http.handlers.reverse_proxy","msg":"selected upstream","dial":"216.108.230.199:443","total_upstreams":1}
Sep 25 10:24:33 ashburn-va-datacenter.serverpoint.com caddy[50307]: {"level":"debug","ts":1664115873.6375327,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"216.108.230.199:443","duration":0.000012519,"request":{"remote_ip":"73.180.158.177","remote_port":"59635","proto":"HTTP/2.0","method":"GET","host":"matice.com","uri":"/favicon.ico","headers":{"Referer":["https://matice.com/"],"Te":["trailers"],"Accept":["image/avif,image/webp,*/*"],"Accept-Language":["en-US,en;q=0.5"],"Cookie":[],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"],"X-Forwarded-Proto":["https"],"Sec-Fetch-Mode":["no-cors"],"Sec-Fetch-Site":["same-origin"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Dest":["image"],"X-Forwarded-For":["73.180.158.177"],"X-Forwarded-Host":["matice.com"]},"tls":{"resumed":true,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"matice.com"}},"error":"context canceled"}
5. What I already tried:
Putting :443 at end of IP
Changing IP to internal IP
Putting :443 at end of internal IP
Removing https:// from front of IP
Adding this section after IP:
{
header_up X-Real-IP {remote}
}
6. Links to relevant resources:
I didn’t find any