当前位置:论坛首页 > Linux面板 > 求助

phpmyadmin如何设置https

发表在 Linux面板2017-10-12 21:31 [复制链接] 4 2934

本帖最后由 lhsama 于 2017-10-12 22:57 编辑

面板绑定了域名,并开启了ssl加密,但通过面板数据库进入phpmyadmin默认是http,请问怎么设置成https
已尝试设置nginx.conf 无效
使用道具 举报 只看该作者 回复
发表于 2017-10-12 22:50:44 | 显示全部楼层
这个应该是修改nginx.conf文件就可以
软件管理----nginx -- 设置 -- 配置修改 -- 拉到下面就会发现下面代码,这里添加证书配置应该就可以
  1. server
  2.     {
  3.         listen 888;
  4.         server_name www.bt.cn;
  5.         index index.html index.htm index.php;
  6.         root  /www/server/phpmyadmin;

  7.         #error_page   404   /404.html;
  8.         include enable-php.conf;

  9.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  10.         {
  11.             expires      30d;
  12.         }

  13.         location ~ .*\.(js|css)?$
  14.         {
  15.             expires      12h;
  16.         }

  17.         location ~ /\.
  18.         {
  19.             deny all;
  20.         }

  21.         access_log  /www/wwwlogs/access.log;
  22.     }
复制代码


使用道具 举报 回复 支持 反对
发表于 2017-10-12 22:57:40 | 显示全部楼层
clang 发表于 2017-10-12 22:50
这个应该是修改nginx.conf文件就可以
软件管理----nginx -- 设置 -- 配置修改 -- 拉到下面就会发现下面代码 ...

试过了,没用
使用道具 举报 回复 支持 反对
发表于 2017-10-13 10:04:29 | 显示全部楼层
求解决方法啊
使用道具 举报 回复 支持 反对
发表于 2017-10-16 15:53:27 | 显示全部楼层
本帖最后由 clang 于 2017-10-16 16:04 编辑

给你个例子,修改我上面回帖那部分nginx 的设置,替换为我下面这个配置,将里面的域名和证书换成你自己:

  1. server
  2.     {
  3.         listen 888;
  4.         server_name www.youdomain.com;
  5.         rewrite ^/(.*)$ https://www.youdomain.com/$1 permanent;
  6.     }
  7. server
  8.     {
  9.         listen 443 ssl http2;
  10.         server_name www.youdomain.com;
  11.         index index.php index.html index.htm default.php default.htm default.html;
  12.         root /www/server/phpmyadmin;
  13.         ssl_certificate /home/ssl/www.youdomain.com_crt.crt;
  14.         ssl_certificate_key /home/ssl/www.youdomain.com_key.key;
  15.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  16.         ssl_prefer_server_ciphers on;
  17.         ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DHE+AES128:!ADH:!AECDH:!MD5;
  18.         ssl_session_timeout 10m;
  19.         ssl_session_cache shared:SSL:10m;
  20.         include enable-php.conf;
  21.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  22.         {
  23.             expires      30d;
  24.             access_log off;
  25.         }
  26.         location ~ .*\.(js|css)?$
  27.         {
  28.             expires      12h;
  29.             access_log off;
  30.         }
  31.         access_log  off;
  32.     }
复制代码
这个就是新建一个phpmyadmin的站点,开启https,然后将原有的那个888端口rewrite过来

使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表