Okay, I finally got the mapped variable figured out!

        map $uri $site_folder {
          ~^/(?P<folder>[a-zA-Z]+)/.*        $folder ;
        }

Now, I just need to figure out how to use it in the location block???

This is what I am trying:

                location ^~ /$site_folder/ {
                        #rewrite ^/$site_folder/(.*) /$1;  
                }


Is it okay to use the named variable in the location like that? It's not
picking it up...

If I use this:

                location ^~ / {
                        return 301 $scheme://www.google.com?q=$site_folder;
                }

It DOES redirect to google with the proper variable in there.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,251908,251921#msg-251921

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to