我正在尝试Cakephp
在我的 Nginx 服务器上设置我的项目。
现在一切正常,但是有一个问题。
当我尝试传递参数时,例如mydomain.com/cake/users/view?searchvalue=test
它不起作用。因为没有发送查询值(即它们被删除、为空或消失)。
现在我不知道是我的Cake
htaccess 干扰还是我的服务器
(因此我为什么要在上面Stackoverflow
而不是在上面发布ServerFault
,请注意,如果您认为这应该是服务器故障,我会删除它并转到那里)。
这是我的 Nginx 文件:
server {
listen 80;
server_name my-domain.com;
return 301 http://www.my-domain.com$request_uri;
}
server{
listen 80 default;
server_name www.my-domain.com;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
#include fastcgi_params;
}
location ~ ^/cake/(.+)$ {
index index.php;
set $val $1;
try_files $uri $uri/ /cake/app/webroot/$val /cake/app/webroot/index.php/$val;
}
如果您需要更多信息,请告诉我!
这是一些附加信息,这是它在尝试访问 my-domain.com/admin/test/servertest 时打印的内容?laura 这是我回显服务器变量时的内容:
array (
'USER' => 'apache',
'HOME' => '/var/www',
'FCGI_ROLE' => 'RESPONDER',
'QUERY_STRING' => ' ', <---- **this is the problem**
'REQUEST_METHOD' => 'GET',
'CONTENT_TYPE' => '',
'CONTENT_LENGTH' => '',
'SCRIPT_FILENAME' => '/usr/share/nginx/html/cake/app/webroot/index.php',
'SCRIPT_NAME' => '/cake/app/webroot/index.php',
'PATH_INFO' => '',
'REQUEST_URI' => '/cake/admin/employees/servertest?laura',
'DOCUMENT_URI' => '/cake/app/webroot/index.php',
'DOCUMENT_ROOT' => '/usr/share/nginx/html',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'SERVER_SOFTWARE' => 'nginx/1.0.15',
'REMOTE_ADDR' => '**.**.***.***',
'REMOTE_PORT' => '53811',
'SERVER_ADDR' => '***.**.***.***',
'SERVER_PORT' => '80',
'SERVER_NAME' => 'www.my-domain.com',
'REDIRECT_STATUS' => '200',
'HTTP_HOST' => 'www.my-domain.com',
'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.5',
'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
'HTTP_COOKIE' => 'bloglic_data[credentials]=Q2FrZQ%3D%3D.XG7at918B4h8lCRNBCdwg0Avi3ZNLdAn28Dl3vfOxaQkJAoJFYxZ0s1a%2Fp3RLB2%2B5krPCIBKFboN4y1X4lY4%2FFautJJ7ce6VyN%2BOgLFbR4KUzn5g7QGDlZS2YqB%2FbZ%2FghYfKzcZvzkYYkvtj9dQkozRMaUPWY8%2F910tf7fnpk8EFAQ%3D%3D; CAKEPHP=7c411r3pc7vhjk3vjqjoplmtk3',
'HTTP_CONNECTION' => 'keep-alive',
'PHP_SELF' => '/cake/app/webroot/index.php',
'REQUEST_TIME_FLOAT' => 1382965704.0475,
'REQUEST_TIME' => 1382965704,
)