1. Caddy version (caddy version
):
V2.1
2. How I run Caddy:
I created a DigitalOcean droplet (ubuntu 18) using the Caddy Droplet from the Marketplace
a. System environment:
Ubuntu 18
b. Command:
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
http://domains.mydomain.com {
errors /var/www/caddy_logs/caddy.log
fastcgi / 127.0.0.1:9001 php
index index.php
root /var/www/mydomain/public
rewrite {
to {path} {path}/ /index.php?{query}
}
}
https://mydomain.com {
email lee@mydomain.com
tls {
on_demand
}
errors /var/www/caddy_logs/caddy.log
fastcgi / 127.0.0.1:9001 php
index index.php
root /var/www/mydomain/public
rewrite {
to {path} {path}/ /index.php?{query}
}
}
https://*.mydomain.com {
email lee@mydomain.com
tls {
on_demand
}
on_demand_tls {
ask http://domains.mydomain.com/allowed
interval 1h
burst 30
}
errors /var/www/caddy_logs/caddy.log
fastcgi / 127.0.0.1:9001 php
index index.php
root /var/www/mydomain/public
rewrite {
to {path} {path}/ /index.php?{query}
}
}
3. The problem I’m having:
I’m getting an error, but it’s not apparent how I can track down further errors to know what portion of my config file is causing the error. I know it’s not correct, I just cannot figure out where I’m wrong to even begin heading down the correct path.
4. Error messages and/or full log output:
/etc/systemd/system# systemctl reload caddy
Job for caddy.service failed because the control process exited with error code.
See "systemctl status caddy.service" and "journalctl -xe" for details.
root@mydomain:/etc/systemd/system# systemctl status caddy.service
â—Ź caddy.service - Caddy
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: active (running) (Result: exit-code) since Mon 2020-08-17 20:51:28 UTC; 2h 28min ago
Docs: https://caddyserver.com/docs/
Process: 18563 ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 1286 (caddy)
Tasks: 10 (limit: 4915)
CGroup: /system.slice/caddy.service
└─1286 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
5. What I already tried:
I’ve tried reducing the config file to be just a root definition and base domain, like the base config, and that works, it’s only when I start trying to map out the actions for the domains that I start running into problems.
Basically, I need the root domain to resolve with https, the domains.mydomain.com to return the domain status of 200 and for the *.mydomain.com I need it to ask domains.mydomain.com for the status.
This is a Laravel app that I had running on Caddy V1 and then shelved for a year. This is what I get for putting it on the backburner
If there was a way to show me what line an error is on it would help me to debug this on my own, I’ve been bashing my head at it for an hour now and I feel like I’m spinning my wheels.