I'm trying to figure out how to force a WordPress site running on NGINX in cPanel to only use SSL. I updated the sites nginx conf file with the following line shown in bold below:
server {
server_name mysite.com www.mysite.com mail.mysite.com;
listen 80;
listen [::]:80;
return 301 https://mysite.com$request_uri;
include conf.d/includes-optional/cloudflare.conf;
set $CPANEL_APACHE_PROXY_PASS $scheme://apache_backend_${scheme}_11_222_333_44;
I restarted NGINX but the site fell over with a message saying too many redirects
server {
server_name mysite.com www.mysite.com mail.mysite.com;
listen 80;
listen [::]:80;
return 301 https://mysite.com$request_uri;
include conf.d/includes-optional/cloudflare.conf;
set $CPANEL_APACHE_PROXY_PASS $scheme://apache_backend_${scheme}_11_222_333_44;
I restarted NGINX but the site fell over with a message saying too many redirects