最近在搭建基于Jenkins的Android apk持续集成编译环境,想让Nginx显示生成apk产物的文件目录列表,经过查阅资料,发现该功能默认是关闭的,需要手动开启。
# vim /data/server/nginx/conf/vhosts/apks.conf
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
# nginx -s reload
- autoindex on: 开启目录显示功能
- autoindex_exact_size on: 开启文件大小详细统计,默认为b,以kb、mb、gb为单位显示
- autoindex_localtime on: 开启以服务器时区显示文件修改日期
注:该代码可在
http{}、server{}、location{}代码块显示




