用nginx搭建简单的文件下载服务器

server {  
    listen       80;        #端口  
    server_name  localhost;   #服务名  
    charset utf-8; # 避免中文乱码
    root    /dev/shm/update;  #显示的根索引目录,注意这里要改成你自己的,目录要存在  

    location / {
        autoindex on;             #开启索引功能  
        autoindex_exact_size off; # 关闭计算文件确切大小(单位bytes),只显示大概大小(单位kb、mb、gb)  
        autoindex_localtime on;   # 显示本机时间而非 GMT 时间  
}
}  

posted @ 2018-03-06 21:58  鸾舞春秋  阅读(202)  评论(0编辑  收藏  举报