#文件下载站
location /ys/ {
alias /ys/;
autoindex on; #开启索引功能
autoindex_exact_size off; # 关闭计算文件确切大小(单位bytes),只显示大概大>小(单位kb、mb、gb)
autoindex_localtime on; # 显示本机时间而非 GMT 时间
}
或
#文件下载站
location /ys {
alias /ys;
autoindex on; #开启索引功能
autoindex_exact_size off; # 关闭计算文件确切大小(单位bytes),只显示大概大>小(单位kb、mb、gb)
autoindex_localtime on; # 显示本机时间而非 GMT 时间
}
或
#文件下载站
location /ys/ {
root /; # location /ys -> root / = /ys 目录
autoindex on; #开启索引功能
autoindex_exact_size off; # 关闭计算文件确切大小(单位bytes),只显示大概大>小(单位kb、mb、gb)
autoindex_localtime on; # 显示本机时间而非 GMT 时间
}
或
#文件下载站
location /ys {
root /; # location /ys -> root / = /ys 目录
autoindex on; #开启索引功能
autoindex_exact_size off; # 关闭计算文件确切大小(单位bytes),只显示大概大>小(单位kb、mb、gb)
autoindex_localtime on; # 显示本机时间而非 GMT 时间
}
注意
- location 和 alias 要对应,
不能 location /ys/ 而 alias /ys 或
不能 location /ys 而 alias /ys/