Search code examples
azureflasknginxdeploymentcloudflare

NGINX + Cloudflare SSL Certificate is not valid


I've tried to set a simple server for testing purpose. I am totally new in website deployment so i don't know how to resolve this.

enter image description here

this is nginx conf:

server {
    listen 80;
    listen [::]:80;
    server_name shhossain.info www.shhossain.info;
    return 302 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_certificate         /etc/ssl/certs/cert.pem;
    ssl_certificate_key     /etc/ssl/private/key.pem;
    server_name shhossain.info www.shhossain.info;

    location / {
                include proxy_params;
                proxy_pass http://unix:/home/sifat/python/flask-app-demo/shhossain.sock;
        }
}

cert.pem and key.pem i've copied from cloudflared Origin Certificates. i am using azure for web hosing.

I've followed this tutorial. https://www.digitalocean.com/community/tutorials/how-to-host-a-website-using-cloudflare-and-nginx-on-ubuntu-20-04


Solution

  • "Set the SSL/TLS encryption mode to 'Full' or Full (Strict)"

    "Terminal:" "sudo systemctl restart nginx" Ensure all traffic coming through Cloudflare is passing through Cloudflare's SSL/TLS protection.

    Make sure your DNS records (such as A or CNAME records) are proxied through Cloudflare.

    Check again from an incognito tab or another computer without cache.