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

如遇技术问题,请联系博主帮您解决QQ 452336092(添加时注明”付费技术支持”)。

今天在配置nginxhttps支持,把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.  
  8.     include       /etc/nginx/mime.types;
  9.     default_type  application/octet-stream;
  10. .........
  11. }

之后重载nginx即生效.

转载请保留原文链接:Linux运维日志 » phpmyadmin错误The plain HTTP request was sent to HTTPS port

打赏

如果此文对你有所帮助,请随意打赏鼓励作者^_^

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址