最新消息: 新版网站上线了!!!

phpmyadmin错误The plain HTTP request was sent to HTTPS port

今天在配置nginx的https支持,把phpmyadmin放在一个子目录下,即https://ip/phpmyadmin,登录出现The plain HTTP request was sent to HTTPS port错误,现给出解决方法:

1.在location ~ .php$区域添加fastcgi_param HTTPS on;如以下代码:

  1. location ~ \.php$ {

  2.                 fastcgi_index index.php;

  3.                 include /etc/nginx/fastcgi_params;

  4.                 fastcgi_param HTTPS on;

  5.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

  6.                 fastcgi_pass 127.0.0.1:9000;

  7.         }

2.在http区域添加

  1. map $scheme $fastcgi_https {

  2. default off;

  3. https on;

  4. }

如例子:

  1. http

  2. {

  3. map $scheme $fastcgi_https {

  4. default off;

  5. https on;

  6. }

  7.     include       /etc/nginx/mime.types;

  8.     default_type  application/octet-stream;

  9. .........

  10. }

之后重载nginx即生效.

 

转载请标明文章来源:《http://www.centos.bz/2011/12/the-plain-http-request-was-sent-to-https-port/

转载请注明:谷谷点程序 » phpmyadmin错误The plain HTTP request was sent to HTTPS port