Is there a way to proxy_pass requests to an application server only if the requested file exists?
There is the if (!-f $request_filename)
way, but it is strongly recommended against by the nginx documentation: https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/