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配置文件如下:

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


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

http直接访问演示正常:

到此解决

浙公网安备 33010602011771号