我这里有一个奇怪的问题。我刚刚从 apache + mod_php 转移到 nginx + php-fpm。除了这个问题,一切都很好。
我有一个网站,比如说example.com。当我像example.com?test=get_param
$_SERVER['REQUEST_URI']
is一样访问它时/?test=get_param
,还有一个$_GET['test']
。
但是,当我访问example.com/ajax/search/?search=get_param
$_SERVER['REQUEST_URI']
时/ajax/search/?search=get_param
仍然没有$_GET['search']
(有没有$_GET
在所有的阵列)。
我正在使用 Kohana 框架。哪个路由/ajax/search
到控制器,但我已经把它phpinfo()
放在index.php
所以我$_GET
在框架做任何事情之前检查变量(这意味着消失的获取参数不是框架的错误)。
我的nginx.conf是这样的
worker_processes 4;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
index index.html index.php;
autoindex on;
autoindex_exact_size off;
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
error_log …
Run Code Online (Sandbox Code Playgroud)