laravel应用程序中的所有GET变量都为空,并且配置正确

时间:2015-05-26 22:33:47

标签: php nginx

我正在经历一些非常奇怪的事情。我的所有请求变量都是空的。在我的index.php文件中,我执行以下操作:

var_dump($_REQUEST); die();

在触发`myapp.dev/test?query=val

时会导致空数组

我的nginx配置如下:

server {
  listen                *:80;

  server_name           animekyun.dev ;
  client_max_body_size 8m;

  root /var/www/animekyun/public;
    index  index.html index.htm index.php;

  access_log            /var/log/nginx/pvf5a8g97whg.access.log;
  error_log             /var/log/nginx/pvf5a8g97whg.error.log;

  location / {

    root  /var/www/animekyun/public;
    try_files $uri $uri/ index.php;
    index  index.html index.htm index.php;


  }
  location ~ \.php$ {

    root  /var/www/animekyun/public;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    try_files $uri $uri/ index.php /index.php$is_args$args;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;

    fastcgi_param SCRIPT_FILENAME $request_filename;
    fastcgi_param ENV local;

  }
  sendfile off;
}

具有完全相同配置的另一个vhost(server_name除外,root等)确实有效。我不知道在哪里搜索来解决这个问题。这不是Laravel中的问题,因为index.php文件的开头请求为空。

我也试过

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

指针是受欢迎的,因为我不知道我应该如何调试它。

编辑: 似乎只要我访问带有漂亮网址的URI,就会发生这种情况。所以这有效:

index.php?get=something

但这不是

myapp.dev/someroute/?get=something

0 个答案:

没有答案
相关问题