1. My Caddy version (caddy -version
):
v2.0.0-beta11
2. How I run Caddy:
a. System environment:
macOS High Sierra 10.13.6
b. Command:
sudo caddy run -config /usr/local/etc/Caddyfile -adapter caddyfile
c. Service/unit/compose file:
-
d. My complete Caddyfile:
{
admin {
disabled true
}
}
localhost:80 {
tls off
respond 200 {
body "It works!"
close
}
}
(This is a reduced test case of the actual Caddyfile I’m using.)
3. The problem I’m having:
I’m trying to disable the admin endpoint completely using the Caddyfile syntax.
It looks like the global admin
Caddyfile option isn’t documented yet in the v2 docs. I was able to find out that it supports the listen address like so:
{
admin :1234
}
…but all variants I have tested to disable the endpoint completely (admin off
, admin false
and the variant from my Caddyfile above) didn’t work.
4. Error messages and/or full log output:
Output of caddy adapt
for the Caddyfile above:
{
"admin": {
"listen": "localhost:2019"
},
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":80"
],
"routes": [
{
"match": [
{
"host": [
"localhost"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"body": "It works!",
"close": true,
"handler": "static_response",
"status_code": 200
}
]
}
]
}
]
}
]
}
}
}
}
}
Output of the run
command:
2019/12/28 16:18:06.376 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["localhost:2019"]}
2019/12/28 16:18:06.376 INFO http server is only listening on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 80}
2019/12/28 17:18:06 [INFO][cache:0xc000684e60] Started certificate maintenance routine
2019/12/28 16:18:06.378 INFO tls cleaned up storage units
2019/12/28 16:18:06.378 INFO admin Caddy 2 serving initial configuration
5. What I already tried:
See 3.