title: NGINX configuration. PHP frameworks with PATHINFO 404
body: <p>I usually use apache and want to give NGINX a try.</p>
  
  <p>I have installed it on my ubuntu dev machine and have a few different frameworks and sites set up and in development (codeigniter, symfony, laravel, etc).</p>
  
  <p>The problem I'm getting is that only paths that end with <code>.php</code> work. If I try <code>index.php/welcome/index</code> it just 404s instead of loading index.php.</p>
  
  <p>I have tried with cgi.fix_pathinfo set to 1 and 0.</p>
  
  <p>Here is my current (of many tried) site config.</p>
  
  <pre><code>server {
  listen   80; ## listen for ipv4; this line is default and implied
  #listen   [::]:80 default_server ipv6only=on; ## listen for ipv6
  
  root /my/path;
  index index.php index.html;
  
  # Make site accessible from http://localhost/
  server_name localhost;
  
  #error_page 404 /404.html;
  
  # redirect server error pages to the static page /50x.html
  #
  #error_page 500 502 503 504 /50x.html;
  #location = /50x.html {
  #   root /usr/share/nginx/www;
  #}
  
  location ~ \.php$ {
      try_files $uri =404;
  
      # Fix for server variables that behave differently under nginx/php-fpm than typically expected
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      # Include the standard fastcgi_params file included with nginx
      include fastcgi_params;
      fastcgi_param  PATH_INFO        $fastcgi_path_info;
      fastcgi_index index.php;
      # Override the SCRIPT_FILENAME variable set by fastcgi_params
      fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
      # Pass to upstream PHP-FPM; This must match whatever you name your upstream connection
      fastcgi_pass unix:/var/run/php5-fpm.sock;
  }
  
  
  location / {
      # First attempt to serve request as file, then
      # as directory, then fall back to displaying a 404.
      try_files $uri $uri/ =404;
      # Uncomment to enable naxsi on this location
      # include /etc/nginx/naxsi.rules
  }
  
  # deny access to .htaccess files, if Apache's document root
  # concurs with nginx's one
  #
  location ~ /\.ht {
      deny all;
  }
  }
  </code></pre>