解決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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章