前端集合 - 关注前端技术和互联网免费资源

关注前端技术和互联网免费资源

分类儿

页面儿

搜索儿

前端集合 RSS订阅
Home » 经验记录 » 如何解决宝塔 ssl 证书 no "ssl_certificate" is defined for the "listen ... ssl" 错误?

如何解决宝塔 ssl 证书 no "ssl_certificate" is defined for the "listen ... ssl" 错误?

发布者:前端集合 // 发布时间:2022-10-08 23:27:00 // 分类:经验记录 // 访问: 2,134 次 // 热度:

起因

升级了 nginx 版本,未备份配置文件。导致网站无法访问。

在配置 ssl 证书时,始终报错:

nginx: [emerg] no "ssl_certificate" is defined for the "listen ... ssl" directive in /www/server/panel/vhost/nginx/xxx.conf:2
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed

解决方案

在宝塔后台对应网站【配置文件】里加入如下代码:

#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    #HTTP_TO_HTTPS_START

再去【ssl】选中点击【保存并启用证书】即可。

Tags: ssl, 证书, 宝塔, https, https证书

记第一次汽车年检流水账>>  << node.js 安装依赖提示 python 2.7 版本太低的解决方案
Top