try_files with a named location for the fallback

The usual front-controller line repeats the PHP handler configuration, because the fallback has to be a URI and the PHP location has its own fastcgi_pass block. A named location lets the fallback be a block rather than a path.

location / {
    try_files $uri $uri/ @app;
}

location @app {
    fastcgi_pass  unix:/var/run/php/php7.0-fpm.sock;
    include       fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root/index.php;
}

The gain is that the front controller is named once, so a request for a missing static file does not go through a rewrite to /index.php and then match the .php$ location again. It also means location ~ .php$ can be removed entirely on an application where no PHP file other than the front controller should ever be reachable — which closes the uploaded-file execution hole by construction rather than by rule.