I have these working directives:
location /en/tools {
alias /srv/nuxt/tools/dist/en/tools;
try_files $uri $uri/ @cache;
}
location /ar/tools {
alias /srv/nuxt/tools/dist/ar/tools;
try_files $uri $uri/ @cache;
}
location /he/tools {
alias /srv/nuxt/tools/dist/he/tools;
try_files $uri $uri/ @cache;
}
I have tried to combine them into one regex based directive but the server returns error 403:
location ~* ^/(en|ar|he)/tools/(.*) {
alias /srv/nuxt/tools/dist;
try_files $uri $uri/ @cache;
}
alias
for any of yourlocation
blocks. Useroot /srv/nuxt/tools/dist;
. Nginx processes prefix locations very efficiently. regular expressions need to be evaluated individually by a separate library.