I want to disable http to https redirect to put the website behind Cloudflare.
As soon as my website gets active on Cloudflare I have an error “The page isn’t redirecting properly”, because Cloudflare expects HTTP traffic.
In my /etc/nginx/nginx.conf
I have an http
block. Within the block I have only these SSL settings:
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE|
ssl_prefer_server_ciphers off;
I commented out the first line and changed ciphers from on to off. That didn’t help me. I have no more HTTPS-related settings in this file.
My next try was to remove ssl.conf file:
rm /etc/nginx/sites-available/www.<my_domain_name>-ssl.conf
As a result I couldn’t access my website at all. “Safari can’t establish a secure connection”. Also, in the address bar I specifically stated to serve http version and it kept redirecting me to https.
I read this tutorial and this one with nginx.conf
file modification, but they look nothing like my file, which is quite empty.
However, /etc/nginx/sites-available/www.<my_domain_name>-ssl.conf
looks similar:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.<my_domain_name>;
root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)
ssl_certificate /etc/letsencrypt/www.<my_domain_name>/fullchain.cer;
ssl_certificate_key /etc/letsencrypt/www.<my_domain_name>/www.<my_domain_name>.key;
include /etc/nginx/snippets/ssl-params.conf;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
location ~ /.well-known {
allow all;
}
client_max_body_size 1g;
}
And here is /etc/nginx/sites-available/www.<my_domain_name>.conf
:
server {
listen 80;
listen [::]:80;
server_name www.<my_domain_name>;
root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
location ~ /.well-known {
allow all;
}
client_max_body_size 50m;
}
What modifications should I do to remove the https redirect?
So when I would type the command:
curl -ksvo /dev/null http://www.<my_domain_name> --connect-to ::<my_IP> 2>&1 | egrep -i "< location|< http"
I could receive:
< HTTP/1.1 200 OK