like this ?
:80 {
# Set this path to your site’s directory.
root * /usr/share/caddy
# Enable the static file server.
file_server
reverse_proxy https://localhost:8443 {
header_up Host {http.reverse_proxy.upstream.hostport}
lb_policy round_robin
lb_try_duration 5s
health_status 200
health_interval 10s
fail_duration 30s
transport http {
tls
tls_insecure_skip_verify
}
}
}
Here is logs
{“level”:“info”,“ts”:1630636157.0301752,“msg”:“using adjacent Caddyfile”}
{“level”:“warn”,“ts”:1630636157.0322042,“msg”:“input is not formatted with ‘caddy fmt’”,“adapter”:“caddyfile”,“file”:“Caddyfile”,“line”:2}
{“level”:“info”,“ts”:1630636157.0368593,“logger”:“admin”,“msg”:“admin endpoint started”,“address”:“tcp/localhost:2019”,“enforce_origin”:false,“origins”:[“localhost:2019”,"[::1]:2019",“127.0.0.1:2019”]}
{“level”:“info”,“ts”:1630636157.0374336,“logger”:“tls.cache.maintenance”,“msg”:“started background certificate maintenance”,“cache”:“0xc0003b5a40”}
{“level”:“info”,“ts”:1630636157.0375242,“logger”:“http”,“msg”:“server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server”,“server_name”:“srv0”,“http_port”:80}
{“level”:“info”,“ts”:1630636157.0375242,“logger”:“tls”,“msg”:“cleaning storage unit”,“description”:“FileStorage:C:\Windows\system32\config\systemprofile\AppData\Roaming\Caddy”}
{“level”:“info”,“ts”:1630636157.0375242,“logger”:“tls”,“msg”:“finished cleaning storage units”}
{“level”:“info”,“ts”:1630636157.0388598,“msg”:“autosaved config (load with --resume flag)”,“file”:“C:\Windows\system32\config\systemprofile\AppData\Roaming\Caddy\autosave.json”}
{“level”:“info”,“ts”:1630636157.0388598,“msg”:“serving initial configuration”}
{“level”:“error”,“ts”:1630636166.8194375,“logger”:“http.log.error”,“msg”:“remote error: tls: handshake failure”,“request”:{“remote_addr”:"[::1]:50408",“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“localhost”,“uri”:"/",“headers”:{“Upgrade-Insecure-Requests”:[“1”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Sec-Fetch-Site”:[“none”],“Cache-Control”:[“max-age=0”],“Sec-Ch-Ua-Platform”:["“Windows”"],“Sec-Ch-Ua”:["“Google Chrome”;v=“93”, " Not;A Brand";v=“99”, “Chromium”;v=“93"”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Sec-Fetch-User”:["?1"],“Sec-Fetch-Dest”:[“document”],“Accept-Language”:[“en-US,en;q=0.9”],“Connection”:[“keep-alive”],“Sec-Ch-Ua-Mobile”:["?0"],“Sec-Fetch-Mode”:[“navigate”],“Accept-Encoding”:[“gzip, deflate, br”]}},“duration”:5.0313103,“status”:502,“err_id”:“129w4g5nq”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}
{“level”:“error”,“ts”:1630636175.6167772,“logger”:“http.log.error”,“msg”:“no upstreams available”,“request”:{“remote_addr”:"[::1]:50408",“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“localhost”,“uri”:"/",“headers”:{“Sec-Ch-Ua”:["“Google Chrome”;v=“93”, " Not;A Brand";v=“99”, “Chromium”;v=“93"”],“Sec-Ch-Ua-Mobile”:["?0"],“Sec-Ch-Ua-Platform”:["“Windows”"],“Upgrade-Insecure-Requests”:[“1”],“Accept-Encoding”:[“gzip, deflate, br”],“Sec-Fetch-Dest”:[“document”],“Connection”:[“keep-alive”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Sec-Fetch-Site”:[“none”],“Sec-Fetch-Mode”:[“navigate”],“Sec-Fetch-User”:["?1"],“Cache-Control”:[“max-age=0”],“Accept-Language”:[“en-US,en;q=0.9”]}},“duration”:5.0137696,“status”:502,“err_id”:“v5yz983dq”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}
{“level”:“error”,“ts”:1630636187.651701,“logger”:“http.log.error”,“msg”:“no upstreams available”,“request”:{“remote_addr”:"[::1]:50408",“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“localhost”,“uri”:"/",“headers”:{“Upgrade-Insecure-Requests”:[“1”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Cache-Control”:[“max-age=0”],“Sec-Ch-Ua”:["“Google Chrome”;v=“93”, " Not;A Brand";v=“99”, “Chromium”;v=“93"”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Accept-Encoding”:[“gzip, deflate, br”],“Connection”:[“keep-alive”],“Sec-Ch-Ua-Platform”:["“Windows”"],“Sec-Fetch-Site”:[“none”],“Sec-Ch-Ua-Mobile”:["?0"],“Sec-Fetch-Mode”:[“navigate”],“Sec-Fetch-User”:["?1"],“Sec-Fetch-Dest”:[“document”],“Accept-Language”:[“en-US,en;q=0.9”]}},“duration”:5.0137427,“status”:502,“err_id”:“ii9hbgwja”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}
{“level”:“error”,“ts”:1630636205.9394557,“logger”:“http.log.error”,“msg”:“remote error: tls: handshake failure”,“request”:{“remote_addr”:“172.26.4.0:60518”,“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“172.26.4.0”,“uri”:"/",“headers”:{“Upgrade-Insecure-Requests”:[“1”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Accept-Encoding”:[“gzip, deflate”],“Accept-Language”:[“en-US,en;q=0.9”],“Connection”:[“keep-alive”],“Cache-Control”:[“max-age=0”]}},“duration”:5.0199614,“status”:502,“err_id”:“tzstb2dff”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}
{“level”:“error”,“ts”:1630636219.9360006,“logger”:“http.log.error”,“msg”:“no upstreams available”,“request”:{“remote_addr”:“172.26.4.0:60518”,“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“172.26.4.0”,“uri”:"/",“headers”:{“Accept-Language”:[“en-US,en;q=0.9”],“Connection”:[“keep-alive”],“Cache-Control”:[“max-age=0”],“Upgrade-Insecure-Requests”:[“1”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Accept-Encoding”:[“gzip, deflate”]}},“duration”:5.0220613,“status”:502,“err_id”:“0scga63y1”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}
{“level”:“error”,“ts”:1630636245.13898,“logger”:“http.log.error”,“msg”:“remote error: tls: handshake failure”,“request”:{“remote_addr”:“172.26.4.0:58266”,“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“172.26.4.0”,“uri”:"/",“headers”:{“Accept-Language”:[“en-US,en;q=0.9”],“Connection”:[“keep-alive”],“Cache-Control”:[“max-age=0”],“Upgrade-Insecure-Requests”:[“1”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Accept-Encoding”:[“gzip, deflate”]}},“duration”:5.0180971,“status”:502,“err_id”:“sqexu06er”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}
{“level”:“error”,“ts”:1630636247.7317302,“logger”:“http.log.error”,“msg”:“no upstreams available”,“request”:{“remote_addr”:"[::1]:50408",“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“localhost”,“uri”:"/",“headers”:{“Sec-Ch-Ua-Mobile”:["?0"],“Upgrade-Insecure-Requests”:[“1”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Sec-Fetch-Site”:[“none”],“Sec-Fetch-User”:["?1"],“Accept-Encoding”:[“gzip, deflate, br”],“Connection”:[“keep-alive”],“Cache-Control”:[“max-age=0”],“Sec-Ch-Ua”:["“Google Chrome”;v=“93”, " Not;A Brand";v=“99”, “Chromium”;v=“93"”],“Sec-Ch-Ua-Platform”:["“Windows”"],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Sec-Fetch-Mode”:[“navigate”],“Sec-Fetch-Dest”:[“document”],“Accept-Language”:[“en-US,en;q=0.9”]}},“duration”:5.0114335,“status”:502,“err_id”:“qsdjxexip”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}
{“level”:“error”,“ts”:1630636259.1721454,“logger”:“http.log.error”,“msg”:“no upstreams available”,“request”:{“remote_addr”:“172.26.4.0:59695”,“proto”:“HTTP/1.1”,“method”:“GET”,“host”:“172.26.4.0”,“uri”:"/",“headers”:{“Connection”:[“keep-alive”],“Upgrade-Insecure-Requests”:[“1”],“User-Agent”:[“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9”],“Accept-Encoding”:[“gzip, deflate”],“Accept-Language”:[“en-US,en;q=0.9”]}},“duration”:5.0141666,“status”:502,“err_id”:“47yr4zxzh”,“err_trace”:“reverseproxy.statusError (reverseproxy.go:857)”}