yeahwu / image

8 stars 1 forks source link

Nginx上开启和美化Autoindex | 无二自留地 #27

Open yeahwu opened 4 years ago

yeahwu commented 4 years ago

https://starts.sh/posts/nginx_autoindex.html

本来想在VPS上挂个网盘的,但想到Nginx上的autoindex好像也够用了。Nginx默认是不允许列出整个目录的,如需此功能,打开nginx.conf文件或你要启用目录浏览虚拟主机的配置文件,在server或location段里添加上autoindex on;来启用目录浏览,下面详细说明。

imjoeyli commented 3 years ago

请问博主,我下载 autoindex.html 到网站目录、并修改相应的 nginx 字段以后,前端页面虽能显示,但是不显示里面的文件和文件夹可能是什么原因?

yeahwu commented 3 years ago

@imjoeyli 请问博主,我下载 autoindex.html 到网站目录、并修改相应的 nginx 字段以后,前端页面虽能显示,但是不显示里面的文件和文件夹可能是什么原因?

应该是没有alias到文件目录。

ctaoist commented 2 years ago

@yeahwu

@imjoeyli 请问博主,我下载 autoindex.html 到网站目录、并修改相应的 nginx 字段以后,前端页面虽能显示,但是不显示里面的文件和文件夹可能是什么原因?

应该是没有alias到文件目录。

因为下载的脚本里面的内容重复了两边,删掉一般就好了,我也是调试了才发现