Cannot setup HTTPS the correct way with CloudFlare Proxy and NginxProxyManager

So I am running Ghost with docker compose, behind a reverse proxy (NginxProxyManager). This is all behind Cloudflare proxy. The only way I can get Ghost to work is to set everything on my end to HTTP. If I do anything else, I get the too many redirects error. I have tried enabling SSL in Nginx proxy manager (using the recommended Nginx config) but it doesn’t work. What should I do?

It’s secure to terminate SSL at NginxProxyManager and have Nginx proxy to Ghost via HTTP. It’s secure because the traffic is on the same host.

If you are still having problems, considering if you need the complexity of a Cloudflare proxy.