i have the same problem,V2: how can caddyfile reverse_proxy to JSON
i want to proxy filebrowser, in caddyfile of caddy1,the config:
in caddy1, i can do it:
127.0.0.1:2016 {
proxy /filebrowser 127.0.0.1:8080
}
it works well,
but i want to use filebrowser in caddy2
in caddy2 json config file,
{
“handler”: “reverse_proxy”,
“transport”: {
“protocol”: “http”,
“read_buffer_size”: 4096
},
“upstreams”: [
{
“dial”: “127.0.0.1:8080”
}
]
}
proxy / to 127.0.0.1:8080. it work well
but i want to proxy /filebrowser to 127.0.0.1:8080
i search all Internet, but do not find the example of json file
i get a response,
“The easiest thing to do if when learning to write JSON configs with Caddy is to write what you want as a v2 Caddyfile then adapt it to JSON with the caddy adapt command.
In Caddy v2, it would look like either of these, depending on whether your upstream service expects the subpath to be stripped or not.
in caddyfile:
handle /filebrowser {
reverse_proxy 127.0.0.1:8080
}
“
i use 'caddy adapt ’ to json, and copy to .json file
but it dont work