Using nginx and CodeIgniter, I have a location block in my server config that handles the routing for my project like this:
location /beta/ {
try_files $uri $uri/ /beta/index.php;
}
This works fine, but I perform backups on this CodeIgniter project and move them to another folder. The "beta" project gets renamed (with a time-stamp). So I have a backups folder with CodeIgniter projects named as such:
backups/beta_2013_05_21_0857
backups/beta_2012_05_23_0750
What I'm trying to do is create another location rule that handles these variable-named projects, but all attempts at using regex so far have failed. If I name the project directly it does work.
location /backups/beta_2013_05_21_0857 {
try_files $uri $uri/ /backups/beta_2013_05_21_0857/index.php;
}
But obviously I don't want to create a rule for each and every folder. Does anyone have any idea on how to solve this? This is the how I was trying to solve the problem:
location /backups/^\w+$/ {
try_files $uri $uri/ /backups/$1/index.php;
}