首页 > 解决方案 > 使用 Nginx 更改默认 URL PhpMyAdmin 的问题

问题描述

我试图更改 PhpMyAdmin 的默认 URL,而不是通过test.com/phpmyadmin我来访问它test.com/admin123

我尝试了本教程没有成功,我创建了一个新的符号链接

符号链接

admin123 -> /usr/share/phpmyadmin/

配置

server {

    index index.php index.html index.htm index.nginx-debian.html;

    location /phpmyadmin {
      root /usr/share/;
      index index.php;
      try_files $uri $uri/ =404;

      location ~ ^/phpmyadmin/(doc|sql|setup)/ {
        deny all;
      }

      location ~ /phpmyadmin/(.+\.php)$ {
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        include snippets/fastcgi-php.conf;
      }
    }

    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
            deny all;
    }

}

问题

我仍然可以正常访问/phpmyadmin而不是/admin123。我恢复Nginx并清空了我的缓存

标签: nginxphpmyadmin

解决方案


推荐阅读