I am trying to build an nginx configuration for an Single Page Application that accesses PHP code through an API. What I am trying to do is map an ajax call of the form /api/xxx through to a file in project_directory/php/xxx.php
So I have a location block like this:-
location ~* /api/(\w+) { root /path/to/project_directory; try_files /php/$1.php =404; ... call fastcgi gateway }  I need to set up $fastcgi_script_name so that it will set all the correct environment variables. Does it do this when try files matches?