最佳答案
In Nginx, I'm trying to define a variable which allows me to configure a sub-folder for all my location blocks. I did this:
set $folder '/test';
location $folder/ {
[...]
}
location $folder/something {
[...]
}
Unfortunately, this doesn't seem to work. While Nginx doesn't complain about the syntax, it returns a 404 when requesting /test/
. If I write the folder in explicitly, it works. So how can I use variables in location blocks?