VPS侦探论坛

 找回密码
 注册
查看: 13595|回复: 2

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

[复制链接]
发表于 2010-10-16 17:23:23 | 显示全部楼层 |阅读模式

配置好SSL以后,访问https的正常,但是访问http的时候就会提示

400 Bad RequestThe plain HTTP request was sent to HTTPS portnginx/0.7.67
我的配置文件如下
  1. server
  2.         {
  3.                 listen       80;
  4.                 listen       443;
  5.                 server_name www.aaa.com;
  6.                 index index.html index.htm index.php;
  7.                 root  /home/wwwroot;

  8. ssl    on;
  9. ssl_certificate    /root/aaa.crt;
  10. ssl_certificate_key     /root/aaa.key;
  11. ssl_session_timeout 5m;

  12. ssl_protocols SSLv2 SSLv3 TLSv1;
  13. ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  14. ssl_prefer_server_ciphers   on;

  15.                 location ~ .*\.(php|php5)?$
  16.                         {
  17.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  18.                                 fastcgi_index index.php;
  19.                                 fastcgi_param HTTPS on;
  20.                                 include fcgi.conf;
  21.                         }

  22.                 location /status {
  23.                         stub_status on;
  24.                         access_log   off;
  25.                 }

  26.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  27.                         {
  28.                                 expires      30d;
  29.                         }

  30.                 location ~ .*\.(js|css)?$
  31.                         {
  32.                                 expires      12h;
  33.                         }

  34.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  35.              '$status $body_bytes_sent "$http_referer" '
  36.              '"$http_user_agent" $http_x_forwarded_for';
  37.                 access_log  /home/wwwlogs/access.log  access;
  38.         }
复制代码


求解决方法,我想让http 和 https同时生效
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-10-16 17:51:26 | 显示全部楼层


我分别新建了两个server,问题是一样的



  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name www.aaa.com;
  5.                 index index.html index.htm index.php;
  6.                 root  /home/wwwroot;
  7.                 .....
  8.         }


  9. server
  10.         {
  11.                 listen       443;
  12.                 server_name www.aaa.com;
  13.                 index index.html index.htm index.php;
  14.                 root  /home/wwwroot;
  15.                 .....
  16.         }
复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2010-10-29 21:14:25 | 显示全部楼层

如果不介意我打个广告的话
看这里:

http://yywudi.info/nginx-https-400-bad-request-solution/

评分

参与人数 1威望 +4 收起 理由
licess + 4 原创内容

查看全部评分

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-8 08:13 , Processed in 0.026957 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表