title: NGINX location rewrite
body: <p>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 - <strong>myMap</strong>) to fastcgi_param  SCRIPT_FILENAME?</p>
  
  <p>The URL:</p>
  
  <pre><code>http://localhost/mapserver/myMap?&amp;LAYERS=base....
  </code></pre>
  
  <p>NGINX config:</p>
  
  <pre><code>  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; 
      }
  </code></pre>
  
  <p>Thanks.</p>