VPS侦探论坛

标题: 400 Bad Request | The plain HTTP request was sent to HTTPS port [打印本页]

作者: ixbear    时间: 2010-10-16 17:23
标题: 400 Bad Request | The plain HTTP request was sent to HTTPS port
配置好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同时生效
作者: ixbear    时间: 2010-10-16 17:51
我分别新建了两个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.         }
复制代码

作者: yywudi    时间: 2010-10-29 21:14
如果不介意我打个广告的话
看这里:

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




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4