I recently added my site to Cloudflare and all of my subdomains like portainer and my file server are working however my main domain that points to my Nginx server returns "error 400 bad request The plain HTTP request was sent to HTTPS port"
I am using caddy to reverse proxy with this config
georgenet.uk:443 {
tls internal
reverse_proxy 192.168.0.50:444
}
georgenet.uk:80 {
tls internal
reverse_proxy 192.168.0.50:81
}
and my Nginx server is using this config
server {
listen 81;
listen [::]:81;
server_name georgenet.uk www.georgenet.uk;
return 302 https://$server_name$request_uri;
}
server {
# SSL configuration
listen 444 ssl http2;
listen [::]:444 ssl http2;
ssl_certificate /etc/ssl/cert.pem;
ssl_certificate_key /etc/ssl/key.pem;
server_name georgenet.uk www.georgenet.uk;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
}
I have already tried ssl off
and ssl on
like many solutions have suggested however I keep getting this error, is it something to do with caddy redirecting the default ports to 81 and 444 as this was working before I started using Cloudflare.