title: Lumen + nginx = error 500, rewrite or internal redirection cycle while internally redirecting to "/index.php"
body: <p>I'm trying to setup <a href="http://lumen.laravel.com/docs/introduction" rel="nofollow">Lumen</a> - "micro-framework" built on top of Laravel's components. On server-side there's nginx + php-fpm.</p>
  
  <p>Here's my nginx config:</p>
  
  <pre class="lang-nginx prettyprint-override"><code>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;
      }
  }
  </code></pre>
  
  <p>This config work fine when I'm calling defined route, e.g. I see "Lumen." response when opening <a href="http://lumen.dev" rel="nofollow">http://lumen.dev</a>. But when I try to open undefined route like <a href="http://lumen.dev/404" rel="nofollow">http://lumen.dev/404</a> I see "500 Internal Server Error" in browser and this message in nginx error log:</p>
  
  <blockquote>
    <p>rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 127.0.0.1, server: lumen.dev</p>
  </blockquote>
  
  <p>How can I fix my nginx conf to make it working?</p>