This is a very similar problem to Nginx configuration leads to endless redirect loop but that discussion has not led me to an answer yet. I\'m learning how to work with ngin
I've toyed around with other answers but nothing worked for me. Then I realized since I use Cloudflare the problem may not be in the server but with Cloudflare. Lo and behold when I set my SSL to Full (Strict) everything works as it should!