I have a nginx configuration that looks like this, where I serve different build versions at different paths. How can I do this using regex/wildcards? I need to be able to capture the path (PATH1, PATH2 etc.) as a variable and use it inside the alias directive as well.
location /sitename/PATH1 {
alias /some/fldr/PATH1;
try_files $uri /sitename/PATH1/index.html;
}
location /sitename/PATH2 {
alias /some/fldr/PATH2;
try_files $uri /sitename/PATH2/index.html;
}
location /sitename/PATH3 {
alias /some/fldr/PATH3;
try_files $uri /sitename/PATH3/index.html;
}
PATH1string equal inlocation,aliasandtry_filesdirectives? AndPATH2andPATH3too? And/some/fldr/path is the same in all three locations?/some/fldris the same in all three locations. The build for/sitename/PATH{X}lives in/some/fldr/PATH{X}