Is there an Nginx variable for the subpath inside the current location, or inside the current alias?
For example, given location /static {...}
and GET /static/booze.png
, is there a variable containing /booze.png
, which would be the subpath inside the current location?
Or otherwise, given location /static { alias /srv/static-files; ...}
and the same GET, is there a variable containing /booze.png
, the subpath inside the current alias?
I know I can use regex locations to capture it, but I'd like to avoid it if I can use a builtin variable.
No, but you may try a trick like this:
The only thing you have to keep in mind - regexp locations have priority over regular ones.