【发布时间】:2015-04-23 21:47:35
【问题描述】:
我的 LEMP 液滴上有以下 nginx 配置:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/html/public;
index index.php index.html index.htm;
server_name server_domain_or_IP;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
我想在/phpmyadmin 上与 Laravel 一起运行 PHPMyAdmin,但只有 Laravel 路由会被提供给浏览器。因此,任何 /phpmyadmin 都会被解析为不是一个路由。
我尝试了多种方法
在
location ~ \.php上方添加我自己的位置/phpmyadmin,甚至尝试^~ /phpmyadmin强制优先。我已将我的根设置为 /usr/share/phpmyadmin,但没有任何结果。
我尝试复制 fastcgi 选项,基本上复制了完整的逻辑,但使用 /phpmyadmin 也没有任何结果
我很确定这可能是我遗漏的一件小事。
【问题讨论】:
-
有什么解决办法吗?我什么都试过了
-
我还没有找到完美的解决方案,我目前正在使用子域...并设置hosts文件。