nginx:从哪里获取 $request_basename
nginx 默认不提供 $request_basename,但你可以使用正则表达式命名组自己定义它
request_basename_example.conf
location ~ ^/(?P<request_basename>[^/]+)$ {
# TODO:在此添加你的代码 - 你可以使用 $request_basename!
}有关用法示例,请参见我之前关于nginx:使用 Content-Disposition 强制整个目录的文件下载的文章。
Check out similar posts by category:
Nginx
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow