bminer
(Blake Miner)
October 26, 2019, 3:32am
1
1. My Caddy version (caddy -version
):
(devel) - version 2 (faf67b10)
2. How I run Caddy:
./caddy run
Loads a Caddyfile and runs
Running Ubuntu Linux 16.04, but that’s besides the point.
3. The problem I’m having:
I don’t know how to set HTTP server errors from a Caddyfile in Caddy v2.
Although, it appears you can do this via JSON config: Home · caddyserver/caddy Wiki · GitHub
4. Error messages and/or full log output:
N/A
5. What I already tried:
Tried errors
and error
directive. Also tried the same in the “global” configuration area. It doesn’t work.
6. Links to relevant resources:
N/A
bminer
(Blake Miner)
October 26, 2019, 3:42am
2
My use case here is a custom 404 and 502 error page. Caddy by default returns the status code but no HTTP response at all.
1 Like
matt
(Matt Holt)
October 26, 2019, 4:29am
3
Thank you for trying v2!
I haven’t gotten around to adding error handling to the v2 Caddyfile yet.
It or some equivalent will be available before the release candidate though!
bminer
(Blake Miner)
October 28, 2019, 5:05pm
4
OK, thanks, @matt ! I’m excited to see what that will look like. I see you guys just added logging. Nice!
I wonder… would it be worthwhile to create a Caddyfile directive that maps 1-to-1 to JSON? That way, I can continue to use the Caddyfile to affect all parts of the v2 configuration…?
Anyway, I’m excited to see Caddy v2 become a thing! It appears to be gaining functionality pretty quickly.
matt
(Matt Holt)
October 28, 2019, 10:35pm
5
That would defeat the purpose of the Caddyfile. If you want that level of control, just use JSON.
Give beta 7 a try! It doesn’t have the error handling in the Caddyfile yet but logging is finished.
system
(system)
Closed
January 26, 2020, 10:37pm
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.