Given the URL below, how can I have NGINX automatically pass the last part of the URL (not the GET Params but the last chunk of the base URL - myMap) to fastcgi_param SCRIPT_FILENAME?
The URL:
http://localhost/mapserver/myMap?&LAYERS=base....
NGINX config:
location /mapserver/ {
fastcgi_pass unix:/tmp/mapserver.sock;
fastcgi_index mapserv?*;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/mapserv?map=/mapfiles/myMap.map;
include fastcgi_params;
}
Thanks.
The documentation states that you can use variables in
fastcgi_param
values :So you can use a location with a regular expression and a capture group :
Be aware that this kind of location has a particular priority during request processing.