我试图更改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
并清空了缓存