Fix www certificate error when the apex domain works
Error: www.domain.com cert error but apex works
The root domain has a valid cert but www. throws a cert error.
Coolify does not auto-include the www subdomain. If you only added the apex, Traefik has no router or cert for www.
The fix
In Coolify → app → Settings → Domains, add https://www.your-domain.com as a SECOND domain alongside the apex.
Make sure a DNS record for www exists and resolves to the VPS:
dig +short www.your-domain.com @8.8.8.8 # should return <your-vps-ip>Redeploy. Traefik will request a cert covering www on the next request.
Related Coolify errors
- Build-time error: process.env.NEXT_PUBLIC_* / VITE_* / API URL is undefined during build — values set in Coolify are empty in the built bundle (e.g. ReferenceError or fetch to "undefined")
- WebSocket connection to 'wss://<your-domain>:6001/app/...' failed (UI shows "WARNING: Cannot connect to real-time service")
- NET::ERR_CERT_AUTHORITY_INVALID
- TRAEFIK DEFAULT CERT / self-signed certificate