码迷,mamicode.com
首页 > Web开发 > 详细

nginx:400 Bad RequestThe plain HTTP request

时间:2018-03-14 00:24:20      阅读:353      评论:0      收藏:0      [点我收藏+]

标签:nginx ssl配置出现400错误

nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS port

nginx 版本nginx/1.12.2
在nginx环境下使用ssl链接出现问题400错误
nginx配置文件如下:
技术分享图片

访问https时候正常,不过直接访问的时候会出现以下错误:
400 Bad Request The plain HTTP request was sent to HTTPS port错误

技术分享图片

技术分享图片

参考官方文档解决方法如下:
删掉ssl on; 并在 listen 443; 443后加上ssl即可

技术分享图片

http直接访问演示正常:
技术分享图片

到此解决

nginx:400 Bad RequestThe plain HTTP request

标签:nginx ssl配置出现400错误

原文地址:http://blog.51cto.com/wujianwei/2086287

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!