1. The problem I’m having:
I’m trying to setup a linux server with a caddy docker as the reverse proxy, and several docker services using various subdomains. Right now, I’m just trying to do one, before I add anymore.
2. Error messages and/or full log output:
$ curl -vL https://localhost
* Trying 127.0.0.1:443...
* Connected to localhost (127.0.0.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Unknown (21):
* TLSv1.3 (IN), TLS alert, internal error (592):
* error:0A000438:SSL routines::tlsv1 alert internal error
* Closing connection 0
curl: (35) error:0A000438:SSL routines::tlsv1 alert internal error
3. Caddy version:
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
4. How I installed and ran Caddy:
I installed caddy via docker-compose.
a. System environment:
VM running Ubuntu 22.04.2 LTS, with Docker:
Docker version 20.10.21, build 20.10.21-0ubuntu1~22.04.3
b. Command:
docker-compose up -d
c. Service/unit/compose file:
version: "3.7"
networks:
web:
external: true
internal:
external: false
driver: bridge
services:
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /data/caddy/Caddyfile:/etc/caddy/Caddyfile
- /data/caddy/data:/data # Optional
- /data/caddy/config:/config # Optional
networks:
- web
- internal
toddsoft:
build:
context: /data/ToddSoft/.devcontainer/
dockerfile: dockerfile
restart: unless-stopped
ports:
- "8080:8080"
environment:
- url=https://toddsoft.toddcom.com
- ServerName=toddsoft.toddcom.com
volumes:
- /data/ToddSoft:/var/www/html
networks:
- internal
d. My complete Caddy config:
{
# Global options block. Entirely optional, https is on by default
# Optional email key for lets encrypt
email rob@toddcom.com
# Optional staging lets encrypt for testing. Comment out for production.
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
debug
}
toddsoft.toddcom.com {
reverse_proxy toddsoft:8080
}
www.toddsoft.toddcom.com {
redir https://toddsoft.toddcom.com{uri}
}
5. Links to relevant resources:
I started with this tutorial. But I haven’t done anything with ghost.
It’s probably important to note that I had a VM running a basic webserver at this location with SSL installed using certbot and had it all running just fine. The router and dns entries have all been configured for about two years working flawlessly. Now I had to rebuild the VM but I can’t seem to get it to work with caddy. Thanks for any help you guys can offer.