Q:

nginx as PHP service entrypoint

Question
The main question here - how to serve static assets included with /vendor/ prefix in URL with separate nginx config location?
Desired behavior is - nginx as root entrypoint that apply SSL certificate, then it serve static assets and all other requests are handled by php interpreter.

A:

You can achieve what you want with a simple config like:
location / {
    # This is cool because no PHP is touched for static content.
    # include the "?$args" part so non-default permalinks doesn't break when using query string
    try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
    include fastcgi_params;
    fastcgi_pass unix:/var/run/php-fpm/example.com.sock;
}

But if you want to get ultimate performance, see this article on try_files drawbacks and how to configure NGINX without it.

