php - nginx配置HTTPS出错
巴扎黑
巴扎黑 2017-04-27 09:01:22
0
5
744

浏览器报错信息

Nginx配置

巴扎黑
巴扎黑

Antworte allen(5)
Peter_Zhu

你不会是用IP地址直接访问的吧? 证书证明的是域名,一定要用证书绑定的域名访问。

洪涛

nginx启动不报错?

左手右手慢动作

nginx -t看了没,还有日志没记录么

伊谢尔伦

证书是对域名签发的,你用ip访问当然会出现这样的情况呀,因为找不到IP 对应的证书啊!

黄舟

数字证书的路径要使用绝对路径,例如:

    ssl_certificate         /usr/local/nginx/ssl/enginx.net.crt;
    ssl_certificate_key     /usr/local/nginx/ssl/enginx.net.key;

还有server_name不能用127.0.0.1,请使用域名,例如:

    server_name             enginx.net;

以下是我的SSL配置文件:

    ssl                     on;
    ssl_certificate         /usr/local/nginx/ssl/enginx.net.crt;
    ssl_certificate_key     /usr/local/nginx/ssl/enginx.net.key;
    ssl_buffer_size         16k;
    ssl_ciphers             ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:DES-CBC3-SHA;
    ssl_prefer_server_ciphers   on;
    ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
    ssl_session_cache       builtin:20480 shared:SSL:10m;
    ssl_session_timeout     1h;
    ssl_stapling            on;
    ssl_session_tickets     on;
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage