码迷,mamicode.com
首页 > 其他好文 > 详细

Nginx try_files $query_string 为空的解决办法

时间:2015-07-31 10:57:52      阅读:473      评论:0      收藏:0      [点我收藏+]

标签:

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



即可解决



Nginx try_files $query_string 为空的解决办法

标签:

原文地址:http://my.oschina.net/jackin/blog/485925

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!