Nginx url routing/rewriting and PHP url parsing
===

On the nginx server I'm working with, I have a very simple configuration so far which has a basic testing location and uses the tools that I've currently built for this purpose.

It's been a while since I've used `nginx`, so I'm having trouble remembering what I did in order to figure this out. 

Basically, I'd like to implement a simple clean url interface. Let's say I have the following directory path:


    site_root / 
              modules /
                      ...
                      ...
                      test /
                           test.base.php
                           test.process.php
                           /* etc */


Rather than specifying something like `http://domain.com/modules/test/test.base.php`, I'd like to query `http://domain.com/test?process` for processing, `test?rdr` for redirecting, etc.

`test.base.php` would be loaded whenever the `/test` location was specified, regardless of the argument passed to it.

the basic PHP code for `test.base.php` would look something like:

    /* url function parses url and returns section based on given index */
    
        switch(url(1)) 
        {
            case 'process':
                  require_once 'test.process.php';
                  break;
            case 'rdr'
                  require_once 'test.rdr.php';
                  break;
            ///more conditions here
            default:
                  //echo out bad query message here and die or something.
                  break;
        }
    
So far, in my nginx configuration, I have the following:

    location /test {
         root /path/to/test;
         rewrite test.base.php test;
         try_files $uri $uri/ test?sk=$arg;
    }

Is it possible to achieve all of this without adding the end slash to `/test` in the url (so it doesn't look something like `/test/?=...`) as well as remove the `sk` parameter and simply call `/test?$arg`? If so, how?




