Merge pull request #74 from svc-design/codex/fix-ansible-template-error-for-openresty

Fix autoindex template logic
This commit is contained in:
shenlan 2025-09-19 20:50:25 +08:00 committed by GitHub
commit cce03cd597

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命中即直接读文件减少一次磁盘判断