Using nginx and CodeIgniter, I have a location block in my server configuration that handles the routing for my project as follows:
location /beta/ { try_files $uri $uri/ /beta/index.php; }
This works fine, but I back up in this CodeIgniter project and move them to another folder. The beta project is being renamed (with a timestamp). Therefore, I have a backup 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 processes these projects with variable names, but all attempts to use the regular expression have not yet worked. If I call the project directly, it works.
location /backups/beta_2013_05_21_0857 { try_files $uri $uri/ /backups/beta_2013_05_21_0857/index.php; }
But obviously, I do not want to create a rule for each folder. Does anyone know how to solve this? This is how I tried to solve the problem:
location /backups/^\w+$/ { try_files $uri $uri/ /backups/$1/index.php; }
source share