Recently I need to do some updating for an nginx configuration, beside the fact that I am a bit rusty with my nginx config skills, I also encounter something like this
location @something {
# ...
}
Not knowing what this mean, did some quick search and found that this is called a named location and it seems like a good alternative to if-then-else in certain scenario.
For example:
Given the request location is /helloworld, if a file called helloworld exist in the root directory, use it else call a named location with the name something
location @something {
# ...
}
location /helloworld {
try_files $uri @something;
}
https://serverfault.com/questions/738452/what-does-the-at-sign-mean-in-nginx-location-blocks