After activating Cloudflare for my domain, I get “The page isn’t redirecting properly” errors for all webpages of the app.
My Nginx logs
There are no errors in the three Nginx logs (nothing that will indicate the source of that problem).
My Nginx confs:
-
nginx virtual host (Certbot-modified)
My question
I used Certbot to configure my SSL. What do I need to change in the Certbot-modified virtual host to bring the site back to work?
My assumption
I assume I should change something here (this second sever
block created by Certbot seems to me like holding redirections), but I’m not sure what exactly to change here:
server {
if ($host = www.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name example.com www.example.com;
listen 80;
return 404; # managed by Certbot
}