企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 1. nginx实现文件共享 通过autoindex on将本地目录建立索引,达到文件共享。 ~~~ server { listen 8987; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; #location / { # root html; # index index.html index.htm; #} location /group1/M00 { root /data/fastdfs/storage/data; #这里是storage的data存储路径 ngx_fastdfs_module; } # 资源定位,开启目录浏览功能 location /appstore { root /home/timing/appstore; # 本地目录(项目的根目录) autoindex on; #自动显示目录 } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } ~~~ 这样就可以下载目录下的文件了 ![](https://box.kancloud.cn/8adcad0fa316f43099c5e54ff1ad02a0_693x278.png) ## 2.相关配置 > 1. autoindex on | off : > 打开或关闭目录浏览功能,目前的版本默认off(关闭)打开或关闭目录浏览功能 > 2. autoindex_exact_size off: > 默认为on,显示出文件的确切大小,单位是bytes。改为off后,显示出文件的大概大小,单位是kB或者MB或者GB > 3. autoindex_localtime on: > 默认为off,显示的文件时间为GMT时间。改为on后,显示的文件时间为文件的服务器时间