Nginx try_files $query_string 为空的解决办法

在配置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;



即可解决



文章来自:http://my.oschina.net/jackin/blog/485925
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3