VPS侦探论坛

 找回密码
 注册
查看: 3983|回复: 2

关于空主机头(开启ssl)

[复制链接]
发表于 2019-3-17 22:33:06 | 显示全部楼层 |阅读模式

资料:对于开启了https的用户,未添加https站点的域名,也可以https访问,只是会访问默认的https网站并提示不安全、域名证书不匹配。
开启SSL后https的空主机头的设置复制内容到剪贴板代码:server {
listen 443 default_server;
server_name _;
ssl on;
ssl_certificate 随便设置一个ssl证书;
ssl_certificate_key 随便设置一个ssl证书的key;
return 500;
}


请问军哥:

关于:随便设置一个ssl证书  和 随便设置一个ssl证书的key  


我乱打了一堆英文字母(09809jlkjppipoipipipoipoi),重启 nginx报错了,如下:


  1. [root@iZbp1fgnu2pf6e1wjvotm2Z conf]# lnmp nginx restart
  2. +-------------------------------------------+
  3. |    Manager for LNMP, Written by Licess    |
  4. +-------------------------------------------+
  5. |              https://lnmp.org             |
  6. +-------------------------------------------+
  7. Stoping nginx... nginx: [emerg] BIO_new_file("/usr/local/nginx/conf/09809jlkjppipoipipipoipoip") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/09809jlkjppipoipipipoipoip','r') error:2006D080:BIO routines:BIO_new_file:no such file)
  8. failed. Use force-quit
  9. Terminating nginx...  done
  10. Starting nginx... nginx: [emerg] BIO_new_file("/usr/local/nginx/conf/09809jlkjppipoipipipoipoip") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/09809jlkjppipoipipipoipoip','r') error:2006D080:BIO routines:BIO_new_file:no such file)
  11. failed
复制代码




那么开启SSL的,这儿,具体该填啥,能否给个案例谢谢!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2019-3-17 22:48:26 | 显示全部楼层


ssl_certificate 随便设置一个ssl证书;
ssl_certificate_key 随便设置一个ssl证书的key;

这个虽然说是随便,意思是文件必须要存在啊,而且nginx下记得也必须是真ssl证书(最起码格式要对),不能随便vim编辑个空文本,至于是不是站点的配套的,这个可以随便
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2019-3-18 09:42:59 | 显示全部楼层

回复 2# 的帖子


明白了哈,谢谢:lol
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-17 02:13 , Processed in 0.027048 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表