Laravel pagination and Nginx

So we are still benefitting the completeness of the Laravel framework and started using the Pagination functions of Laravel. Which is absurdly easy except for a slight hiccup which needed some configuration of the web server.

Since Laravel captures all url requests and captures the

/?page=

parameter to do its magic, this parameter must be accepted by Nginx as part of the request. By default the ubuntu Nginx implementation we use actually has the following configured for the server

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

, this results in a 404 error when using larval pagination. So to get it working just use

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

in the Nginx server configuration (watch the question mark) and you can enjoy the pleasure of using Laravels pagination implementation.