nginx - 使用 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
并清空了我的缓存
解决方案
推荐阅读
- javascript - jQuery默认加载时选择的年份和月份
- hive - 在直线中,使用“create table table_name as select * from”不起作用
- vue.js - 在 vuex 状态更改后添加延迟
- python - ImportError:无法从“matplotlib”导入名称“_png”
- java - 递归排序:快速排序语法
- api - 如何使用空键在邮递员的表单数据中获取数据值
- vb.net - 使用 vb.net 分别保存 xml 文件
- angular - Angular8:如何在 mat-form 字段轮廓中添加框阴影
- angular - 你能明白为什么@Output 不会发送到它的父组件吗?
- django - 如何在 Django 中通过 POST 方法进行搜索