502 Bad Gateway Error with Cloudflare Tunnel on DigitalOcean

Hi everyone, can someone help me figure out what I am doing wrong. I am very new to this, so I will try to be as thorough as I can.

I have a remote Ubuntu 22.04 (LTS) x64 server on DigitalOcean and brought a cheap domain on namecheap which I added to cloudflare tunnel. I am only testing out cloudflare tunnel so I have installed flaresolverr via docker. I use network host mode in all my dockers.

It is accessible via

  1. https://localhost:8191 when connected with SSH & ports mapped.
  2. from any browser. (Fake IP)

I am also running plex bare metal at 32400. Attached, you can see all open ports.

I set up cloudflare tunnel and configured it. During setup I chose debian x64 and connected. In the Public hostname section, I added a subdomain flaresolverr, selected Type as HTTS and URL as localhost:8191. Enabled the “No TLS Verify”

It says Healthy. In the server, systemctl status cloudflared > cloudflared_status.txt shows that cloudflared tunnel is running and in the logs, it shows new config as well.

Feb 29 08:05:07 SR-Server cloudflared[3747]: 2024-02-29T08:05:07Z INF Updated to new configuration config="{\"ingress\":[{\"hostname\":\"flaresolverr.mydomain.store\",\"originRequest\":{\"noTLSVerify\":true},\"service\":\"https://localhost:8191\"},{\"service\":\"http_status:404\"}],\"warp-routing\":{\"enabled\":false}}" version=1

Now if I try https://flaresolverr[.]mydomain[.]store, I always get a Bad Gateway error.

I have tried to replace localhost in the public hostname settings with as well as Same result.

I also downloaded logs from dashboard using log stream which I have as CSV file but not sure how to share here.

Can anyone help me pls?

Endgoal: I want to be able to access a few ports from anywhere using subdomain[.]domain[.]com instead of IP:port everytime. Most of them, I will be running in docker with network mode host.