记一次解决 nginx 反向代理不兼容问题解决

经过简单的排查,确认了是 ssl 的配置问题,win7 不支持 tls1.2 以上,因此需要做降级处理。

配置如下【完整配置参见nginxconfig.io即可】

    # Diffie-Hellman parameter for DHE ciphersuites 此处的秘钥为1024位
    ssl_dhparam /etc/nginx/dhparam.pem;

    # Mozilla Intermediate configuration
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;#注意这里需要写上TLSv1 TLSv1.1来兼容win7
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA;#此处的加密算法要写全,也是出于兼容性问题
    ssl_prefer_server_ciphers on;#同样的多了一项,兼容性问题

重启 nginx 服务器即可

nginx -s reload