Cloudflare and Nginx
Hello, when i use this Nginx config for my nginx server, i get this error on my browser when i visit my website (polido.pt): ERR_TOO_MANY_REDIRECTS
But with this config file for my Nginx server (default one) everything works ok and the website loads:
5 Replies
I just want to know what is causing this issue. Is it because Cloudflare already provides an SSL certificate or?
Yes. Because Cloudflare provides an SSL certificate, an
https:
connection from the browsers perspective may actually be sent to nginx
as a http:
connection. You should be able to fix this by setting your Domain's SSL/TLS encryption mode to Full, or Full(Strict), if your nginx
service has a valid CA cert.Yes, i have a valid certbot Certificate for my domain, but do you think that i should use it since Cloudflare already provides one for free?
You can if you want to(it should allow you to use
Full(Strict)
). Otherwise, you can use Cloudflare Tunnels to provide a secure connection to your server, and then completely disable HTTPS on nginx
(and close both port 80 and 443 in your firewall).Nice, i want to do that!