nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS port
2018-03-01 14:19
471 查看
nginx版本1.0.4
nginx一般情况下配置;
server {
listen 443;
server_name localhost;
ssl on;
root html;
index index.html index.htm;
ssl_certificate cert/214525134250577.pem;
ssl_certificate_key cert/214525134250577.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}然后神器的一幕发生了,首先是: nginx: [warn] invalid value "TLSv1.1" nginx: [warn] invalid value "TLSv1.2"
把 TLSv1.1 TLSv1.2 删掉;报错 nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS port
参考官方文档解决如下:server {
listen 80;
server_name localhost;
root html;
index index.html index.htm;
listen 443 ssl; #注意这里
#ssl on;
ssl_certificate cert/214525134250577.pem;
ssl_certificate_key cert/214525134250577.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}删掉 ssl on; 并在 listen 443; 后面加上ssl即可
nginx官方文档
nginx一般情况下配置;
server {
listen 443;
server_name localhost;
ssl on;
root html;
index index.html index.htm;
ssl_certificate cert/214525134250577.pem;
ssl_certificate_key cert/214525134250577.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}然后神器的一幕发生了,首先是: nginx: [warn] invalid value "TLSv1.1" nginx: [warn] invalid value "TLSv1.2"
把 TLSv1.1 TLSv1.2 删掉;报错 nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS port
参考官方文档解决如下:server {
listen 80;
server_name localhost;
root html;
index index.html index.htm;
listen 443 ssl; #注意这里
#ssl on;
ssl_certificate cert/214525134250577.pem;
ssl_certificate_key cert/214525134250577.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}删掉 ssl on; 并在 listen 443; 后面加上ssl即可
nginx官方文档
相关文章推荐
- nginx: 400 Bad Request | The plain HTTP request was sent to HTTPS port
- Nginx:The plain HTTP request was sent to HTTPS port解决办法
- Nginx出现The plain HTTP request was sent to HTTPS port问题解决方法
- http 400 Bad Request The request sent by the client was syntactically incorrect
- HTTP 400: Bad Request The request sent by the client was syntactically incorrect
- 前端到后端------HTTP Status 400 ( The request sent by the client was syntactically incorrect)
- HTTP Status 400 - description:The request sent by the client was syntactically incorrect.
- 解决 spring mvc3.1下post json出现HTTP Status 400 The request sent by the client was syntactically incorrect
- http 400错误 描述:The request sent by the client was syntactically incorrect
- spring mvc 数据绑定问题 提交表单提示HTTP status 400, The request sent by the client was syntactically incorrect
- velocity http请求400错误HTTP Status 400 The request sent by the client was syntactically incorrect
- 解决 spring mvc3.1下post json出现HTTP Status 400 The request sent by the client was syntactically incorrect
- HTTP Status 400 - description The request sent by the client was syntactically incorrect.
- HTTP Status 400 - The request sent by the client was syntactically incorrect.
- Http 400 --- The request sent by the client was syntactically incorrect
- 转:POST 400 Bad Request The request sent by the client was syntactically incorrect
- POST 400 Bad Request The request sent by the client was syntactically incorrect
- SpringMVC string 转成Date 报错!!! 400 Bad Request,the request was sent.语法上...incorrect
- 400 Bad Request The request sent by the client was syntactically incorrect ().
- spring mvc 数据绑定问题 提交表单提示HTTP status 400, The request sent by the client was syntactically incorrect