Nginx的autoindex 命令可以自动列出目录下的文件,一些网站用这个功能做文件下载,但是Nginx又没有提供这个页面的 自定义的功能,后来看到别人提及 ngx_openresty,才想到 body_filter 阶段可以修改 response 的请求内容,只要进行一些hacking就能完成这个需求啦. Use openresty to modify the page generated by the nginx autoindex command code nginx 配置片段 loca