Avoid redirects from HTTP from HTTPS to HOST from header

I use something like this in nginx

    upstream bigpcs {
        server server1_local;
        server server2.cloudflaretunnel.com;
    }

location /model {
            proxy_pass http://bigpcs;
            proxy_set_header Host      $host;
}

When response is redirected from HTTPS to HTTP it goes not to https://server2.cloudflaretunnel.com, but to $host. How to avoid this bahaviour? I would be happy to apoid HTTPS at all like in this topic, but I can’t do it successfully too after a lot of attempts.

I’ve done disabling of http to https redirect. You should left Proxied status in DNS Records. And you should switch off Always Use HTTPS and Automatic HTTPS Rewrites in SSL/TLS → Edge Certificats page.

But now I’ve just realized, that nginx tries to convert domain to ip. And I can’t get http page by ip with this error

and https by this error

# 403 Forbidden
---
cloudflare

So, is it real to use in upstream by ip at all?