##
# Virtual Host Configs
##
upstream app {
    server unix:/var/run/php-fpm.sock;
}

server {
  listen 80;

  index index.html index.php;
  root /srv/www/;

  location / {
    try_files $uri $uri/ /index.php$is_args$args;
  }

  location ~* \.php$ {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;

    fastcgi_pass   app;
    fastcgi_index  index.php;
    include        fastcgi_params;

    fastcgi_param  PATH_INFO $fastcgi_path_info;
    fastcgi_param  PATH_TRANSLATED $document_root$fastcgi_path_info;
    fastcgi_param  SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    fastcgi_param  DOCUMENT_ROOT $realpath_root;

    try_files $uri =404;
  }
}