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.