Laravel 5/ 5.4 分页器在 NGINX 生产环境中不工作

Laravel 5/ 5.4 paginator is not working in NGINX production environement

在我的本地环境中,我 $items = Model::paginate(10); 成功了。然后我把它推到生产环境,当我点击分页链接时,它一次又一次地显示第 1 页。然后我做了 dd($items)。我发现当我将地址更改为 /items?page=* 时, length aware paginationcurrent Page 属性 并没有改变。如何使当前页面 属性 相应地改变或者有别的东西?提前致谢

我正在使用 ubuntu 16.04 nginx 服务器。问题是 $_GET 会话变量没有正确设置。所以我所做的是在 /etc/nginx/sites-available/defaultlocation / 块/指令中,我将 try_files $uri $uri/ /index.php?$query_string; 更改为 try_files $uri $uri/ /index.php?$args; 并且它起作用了。或参见

非常感谢#Ahmed

我只需要从

更改我的
location / {    
    try_files $uri $uri/ /index.php?$query_string;
}

location / {
    index index.php;
    try_files $uri @rewriteapp;
}

location @rewriteapp {
    rewrite ^(.*)$ /index.php/ last;
}

因为我看到我的一些其他网站正在使用 @rewriteapp 部分并且似乎工作正常。