title: Nginx config for Slim Framework API routes
body: <p>I have been stuck with this for quite some time now. Basically, i have a routing file in my Slim Framework App which routes my API and then i can access the routes like so: "index.php/api/route". This works fine with apache or php -S. But now when i migrated to an nginx server with php5-fpm, i am facing issues with configuring the site properly. I can access index.php, but anything after is a 404. Checking the logs give me "no such file or folder" or "not a directory". Here's my current config:</p>
  
  <pre><code>server {
    listen 80;
    listen [::]:80 default_server ipv6only=on;
    server_name www.site.com;
    root /var/www/site;
    index index.php;
  
    error_log /var/log/nginx/site.error.log;
    access_log /var/log/nginx/site.access.log;
  
    location ~ \.php$ {
      fastcgi_connect_timeout 5s;
      fastcgi_read_timeout 10s;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      #fastcgi_split_path_info ^(.+\.php)(/.*)$;
      fastcgi_index index.php;
      include fastcgi_params;
      #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
  }
  </code></pre>
  
  <p>I tested with the commented out lines, to no success. Any ideas?</p>