配置如下
server {
listen 8900;
server_name localhost;
location / {
# 配置文件下载
root html/download;
autoindex on; #开启索引功能
autoindex_exact_size off; #关闭计算文件确切大小(单位bytes),只显示大概大小(单位kb、mb、gb)
autoindex_localtime on; #显示本机时间而非 GMT 时间
}
location = /50x.html {
root html;
}
}
主要是这几个设置项
# 配置文件下载
root html/download;
autoindex on; #开启索引功能
autoindex_exact_size off; #关闭计算文件确切大小(单位bytes),只显示大概大小(单位kb、mb、gb)
autoindex_localtime on; #显示本机时间而非 GMT 时间