Adding web server to Cloudflare tunnel gives Bad Gateway error

I have a nextcloud home web server and i tried to connect it with cloudflare tunnel but it gives Bad Gateway 502 Error

Can you check your cloudflared logs? Can follow Tunnel logs ยท Cloudflare Zero Trust docs to view them either locally or through the dashboard.