Fix autoindex template logic

This commit is contained in:
shenlan 2025-09-19 20:49:51 +08:00
parent cb665f05bb
commit 3a146d7dfb

View File

@ -24,15 +24,15 @@ server {
add_header Accept-Ranges bytes;
try_files $uri $uri/ =404; # 保持原有 404 语义
}
{% elif %}
{% elif autoindex_paths %}
{% for path in autoindex_paths %}
location {{ path }} {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
# 常见安装包直下读文件(大小写不敏感)
# 这里无需 try_files命中即直接读文件减少一次磁盘判断