您的位置:首页 > 运维架构 > Nginx

Nginx try_files $query_string 为空的解决办法

2015-07-31 09:08 791 查看
在配置Phalcon 的时候,配置的使用是:

server {
listen 80;
server_name localhost.dev;
index index.php index.html index.htm;
set $root_path '/var/www/phalcon/public';
root $root_path;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}

发现PHP无法获取$_GET信息。



try_files $uri $uri/ /index.php;

改为

try_files $uri $uri/ /index.php?$query_string;


即可解决
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: