1. Caddy version (caddy version
):
v2.2.0 h1:sMUFqTbVIRlmA8NkFnNt9l7s0e+0gw+7GPIrhty905A=
2. How I run Caddy:
$ caddy run
a. System environment:
Arch Linux kernel 5.8.14-arch1-1
b. Command:
$ curl -X POST -H "Content-Type: application/json" -d '{"apps":{"http":{"servers":{"my-id":{"listen":[":2015"],"routes":[{"match":[{"host":["localhost:2015"]}],"handle":[{"handler":"static_response","body":"hello"}]}]}}}}}' http://localhost:2019/config/
{"error":"loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: permission denied"}
Formatted JSON body from above request
{
"apps": {
"http": {
"servers": {
"my-id": {
"listen": [
":2015"
],
"routes": [
{
"match": [
{
"host": [
"localhost:2015"
]
}
],
"handle": [
{
"handler": "static_response",
"body": "hello"
}
]
}
]
}
}
}
}
}
3. The problem I’m having:
As far as I can tell, this request should be successful and as a result, Caddy should start listening to localhost:2015 and return “hello” when doing a GET request.
4. Error messages and/or full log output:
ERROR admin.api request error {"error": "loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: permission denied", "status_code": 500}
5. What I already tried:
Digging through source + docs + searched the forum for similar problems. Guess there are some defaults that I’m not finding, or I’m using the wrong syntax for the “Host” but not finding the right places where this is defined.