【发布时间】:2013-04-04 15:52:53
【问题描述】:
我的 phpmyadmin 设置是这样的
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
我希望更改文件夹名称,以便我可以通过 /secure 访问 phpmyadmin
location /secure {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/secure/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/secure/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
但它一直给我 404 未找到,任何帮助将不胜感激,谢谢
【问题讨论】:
-
此配置将根据请求查找 /usr/share/secure。
-
那我该怎么改呢?
-
我从未真正尝试过。一种简单(但不干净)的可能性是将 /usr/share/secure 符号链接到 /usr/share/phpmyadmin - 但是有更好的解决方案,所以我不会将此作为答案发布。你可以阅读 nginx 文档。
-
你能发布一个更好的解决方案吗
标签: php apache configuration nginx