更改nginx autoindex输出格式

时间:2012-04-27 11:54:48

标签: xml nginx mod-autoindex

我想通过http分享文件夹内容。我已经安装了带有autoindex的nginx并将其配置到我的文件夹中。问题是它需要带有文件/文件夹列表的html文件,但我想要一些具有相同信息的xml。

是否可以使用标准的nginx工具来实现,或者我应该实现一些脚本来解决这个问题?

3 个答案:

答案 0 :(得分:4)

您必须使用一些脚本来使其工作。使用nginx配置可以获得的最多是自定义footer and header

顺便说一句,开发人员looks forward将xml索引模块添加到nginx。

答案 1 :(得分:3)

从版本1.7.9开始,您可以使用:

autoindex on;
autoindex_format xml;

请参阅文档:http://nginx.org/r/autoindex_format

答案 2 :(得分:0)

sudo apt安装libnginx-mod-http-fancyindex

  

fancyindex on;