Debug

Cloudflare 301 Redirect Issue

I’ve recently started to use cloudflare and ran into an issue where my site would keep redirecting 301 after setting up the DNS properly.

Normally, I would have checked the nginx logs to see if my requests were hitting my server. From there we can see if we should need to modify our nginx configs or not. But I was fortunately able to resolve the issue from searching a cloudflare support post, where there was a suggestion to set the cloudflare SSL/TLS setting to “Full (strict)” mode.

cloudflare setting image

I think this problem happens due to having HTTPS enabled on my site via lets encrypt on my VPS. Since the default setting on cloudflare is “Flexible” when adding cloudflare to your DNS.