I have 2 subfolders, they are opened on my_url/test1 and my_url/test2
location /test1 {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ /test1 /index.php;
expires 30d; ## Assume all files are cachable
}
location /test2 {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ /test2/index.php;
expires 30d; ## Assume all files are cachable
}
I want to add 3 additional test subfolders (test3, test4, test5) I can continue writing:
location /test3 {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ /test3/index.php;
expires 30d; ## Assume all files are cachable
}
etc. But May be there is some standart way not to dublicate config? Like
location /(subfolder) {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ /(subfolder)/index.php;
expires 30d; ## Assume all files are cachable
}