您的位置:首页技术文章
文章详情页

php - nginx配置HTTPS出错

【字号: 日期:2024-07-04 17:21:35浏览:34作者:猪猪

问题描述

浏览器报错信息php - nginx配置HTTPS出错

Nginx配置php - nginx配置HTTPS出错

问题解答

回答1:

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

回答2:

nginx启动不报错?

回答3:

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

回答4:

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

回答5:

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

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;

相关文章: