废话不多说,直接上代码
// An highlighted block
server {
listen 80;
server_name localhost;
charset utf-8;
location /download {
alias /opt/data;
autoindex on; # 索引
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
}
}
其中最主要的就是
location /download {
alias /opt/data;
autoindex on; # 索引
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
}
访问连接:http://10.18.135.210/download/