1. Caddy version (caddy version
): 2.4.5 alpine
2. How I run Caddy: Docker
a. System environment: Docker linux
b. Command:
c. Service/unit/compose file: docker docker compose
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
app.localhost {
file_server browse
# reverse_proxy 172.172.0.15:8888
}
localhost {
reverse_proxy 172.172.0.15:8181 {
}
}
3. The problem I’m having:
file_server browse works fine, but the reverse proxy is not working i think its because my backend server is Golang Fiber which does not support http2 . How i can tell to reverse proxy using http1 ?
4. Error messages and/or full log output:
{“level”:“error”,“ts”:1635821206.3486726,“logger”:“http.log.error”,“msg”:“dial tcp 172.172.0.15:8181: connect: connection refused”,“request”:{“remote_addr”:“172.172.0.1:44574”,“proto”:“HTTP/2.0”,“method”:“OPTIONS”,“host”:“localhost”,“uri”:"/core/api/v1/open/login",“headers”:{“Sec-Fetch-Site”:[“cross-site”],“Accept-Language”:[“en-US,en;q=0.5”],“Accept-Encoding”:[“gzip, deflate, br”],“Sec-Fetch-Mode”:[“cors”],“Te”:[“trailers”],“User-Agent”:[“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0”],“Access-Control-Request-Headers”:[“content-type”],“Dnt”:[“1”],“Accept”:["/"],“Sec-Gpc”:[“1”],“Sec-Fetch-Dest”:[“empty”],“Access-Control-Request-Method”:[“POST”],“Referer”:[“http://localhost:9000/"],“Origin”:[“http://localhost:9000”]},“tls”:{“resumed”:false,“version”:772,“cipher_suite”:4865,“proto”:“h2”,“proto_mutual”:true,“server_name”:“localhost”}},“duration”:0.000403205,“status”:502,“err_id”:“cr0wg9kk3”,“err_trace”:"reverseproxy.statusError (reverseproxy.go:858)”}