使用Nginx更改默认URL PhpMyAdmin的问题

时间:2019-03-01 18:35:05

标签: nginx phpmyadmin

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

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

符号链接

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并清空了缓存

0 个答案:

没有答案