server {
  listen       80;
  server_name  localhost;

  location / {
      root   /app;
      index  index.php index.html index.htm;
  }

  location ~ [^/]\.php(/|$) {
     fastcgi_split_path_info ^(.+?\.php)(/.*)$;
     if (!-f $document_root$fastcgi_script_name) {
       return 404;
     }
     fastcgi_pass unix:/var/run/php-fpm.sock;
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;
  }
}
