解决nginx给phpmyadmin套娃SSL之后phpmyadmin登录界面弹出警告

使用https转发phpmyadmin请求之后,登录界面显示
There is mismatch between HTTPS indicated on the server and client.
This can lead to non working phpMyAdmin or a security risk.
Please fix your server configuration to indicate HTTPS properly.

nginx config 转发配置里添加改参数就可以消除该警告 proxy_set_header X-Forwarded-Proto $scheme;

server {
  listen 443 ssl;
  server_name phpmyadmin.example.com;
#  http2 on;

  ssl_certificate     /etc/nginx/ssl/example.com/fullchain.cer;
  ssl_certificate_key /etc/nginx/ssl/example.com/guorj.cn.key;
  ssl_client_certificate /etc/nginx/ssl/example.com/fullchain.cer;

  location / {
    proxy_pass http://runPhpmyadmin:80;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

参考:
There is mismatch between HTTPS indicated on the server and client
https://stackoverflow.com/questions/56655548/there-is-mismatch-between-https-indicated-on-the-server-and-client

posted @ 2023-07-07 22:46  nil  阅读(74)  评论(0编辑  收藏  举报