Unable to get tunnel working

I assume your tunnel config looks something like

tunnel: <tunnel id>
credentials-file: /etc/cloudflared/<tunnel id>

    originServerName: example.com
    noTLSVerify: ture

But you also have: :8080.

A 502 error means that cloudflared is unable to connect to your origin server and based on

it seems that you have pointed cloudflared to the wrong port. You should make sure that the config you are using is pointing to the right port.