Nginx将静态文件/目录列出为XML/Json [英] Nginx list static files/directories as XML/Json

查看:378
本文介绍了Nginx将静态文件/目录列出为XML/Json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装nginx的目的是为照片和视频等静态文件提供服务,并能够以编程方式列出所提供的文件.

I installed nginx with the intent of serving static files like photos and videos, being able to programmatically list the files served.

问题在于此列表是在HTML页面中完成的,对于我的应用程序,我需要能够处理此列表(例如json或xml).

The problem is that this listing is done in a HTML page and for my application I needed to be able to process this listing (something like json or xml).

无论如何,我可以使用Nginx做到这一点吗? (或者还有其他替代方法可以解决我的问题)

Is there anyway I can do this with nginx? (Or are there any other alternatives which solve my problem)

提前谢谢.

推荐答案

通过向服务器添加php脚本以列出文件来解决该问题.

Solved the problem by adding a php script to the server to list the files.

这篇关于Nginx将静态文件/目录列出为XML/Json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆