Does nginx have built-in variables that can directly get the file name in the url request? Or the file part?

is like this because the website needs to do some relatively simple but not so simple 301redirects
now the confusion is as follows
for example www.baidu.com/zt/1.html
there is a built-in variable $request_uri that can directly get / zt/1.html
but I want to get the file name part of 1.html
and then I want to ask if there is a built-in variable that can directly get the url.
or is there any way to intercept efficiently?
or must regular be used? Rewrite 301I have already written it, but I read on the Internet that it is not as efficient as return 301xxx.
, so I came to ask for help

.

from-the-request-uri" rel=" nofollow noreferrer "> https://serverfault.com/quest.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bcf4b1-30c54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bcf4b1-30c54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?