nginx:400 Bad RequestThe plain HTTP request

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

nginx 版本nginx/1.12.2
在nginx环境下使用ssl链接出现问题400错误
nginx配置文件如下:
nginx:400 Bad RequestThe plain HTTP request_nginx

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

nginx:400 Bad RequestThe plain HTTP request_配置出现 _02

nginx:400 Bad RequestThe plain HTTP request_配置出现 _03

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

nginx:400 Bad RequestThe plain HTTP request_ssl_04

http直接访问演示正常:
nginx:400 Bad RequestThe plain HTTP request_ssl_05

到此解决

posted @ 2018-03-14 00:10  勤奋的蓝猫  阅读(11)  评论(0编辑  收藏  举报  来源