I'm trying to setup Lumen - "micro-framework" built on top of Laravel's components. On server-side there's nginx + php-fpm.
Here's my nginx config:
server {
server_name lumen.dev;
root /var/www/lumen;
location / {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param SCRIPT_FILENAME /var/www/lumen/public/index.php;
try_files $uri $uri/ /index.php?$query_string;
}
}
This config work fine when I'm calling defined route, e.g. I see "Lumen." response when opening http://lumen.dev. But when I try to open undefined route like http://lumen.dev/404 I see "500 Internal Server Error" in browser and this message in nginx error log:
rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 127.0.0.1, server: lumen.dev
How can I fix my nginx conf to make it working?
root
to/var/www/lumen/public
- lukasgeiter