Hi, i have a problem with caddy api endpoint. I changed the port of end point to 0.0.0.0:2019 for remote connection. then i give permittion for only spesific ips can be use it. everything works fine only i have when i post to 0.0.0.0/load
1. Caddy version (caddy version
):
Caddy v2.2.1
2. How I run Caddy:
sudo systemctl start caddy
a. System environment:
ubuntu 18.04
d. My complete Caddyfile or JSON config:
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"write_timeout": "10s",
"idle_timeout": "10s",
"read_header_timeout": "10s",
"read_timeout": "10s",
"max_header_bytes": "100000000",
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/path/to/frontend/"
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "unix//path/to/sockfile.sock"
}
]
}
],
"match": [
{
"not": [
{
"path": [
"/static*"
]
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"domain.tdl"
]
}
],
"terminal": true
}
]
}
}
}
}
}
3. The problem I’m having:
When i post load new config for reset all caddy config i got error
4. Error messages and/or full log output:
{"error":"loading config: loading new config: starting caddy administration endpoint: listen tcp 127.0.0.1:2019: bind: address already in use"}
i am posting via curl command for testing.
command are bellow
curl -X POST "http://0.0.0.0:2019/load" \
-H "Content-Type: application/json" \
-d '{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"write_timeout": "10s",
"idle_timeout": "10s",
"read_header_timeout": "10s",
"read_timeout": "10s",
"max_header_bytes": "100000000",
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/path/to/frontend/"
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "unix//path/to/sockfile.sock"
}
]
}
],
"match": [
{
"not": [
{
"path": [
"/static*"
]
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"domain.tdl"
]
}
],
"terminal": true
}
]
}
}
}
}
}'
Thank you