很简单的一个配置,不指定为啥,别人写的都好麻烦,而且很多配置了也不行,明明就是几句话的事啊,唉。
话不多说,直接上配置
worker_processes 1;
events {worker_connections 1024;
}
http {include mime.types;default_type application/octet-stream;sendfile on;keepalive_timeout 65;client_max_body_size 500m; server {listen 11111;server_name localhost;charset utf-8;location /downloads/ {alias /data/app/;autoindex on;default_type application/octet-stream;allow all;}}
}
没错,这就完事了,没有多余配置,访问直接就可以访问到了
如果想直接下载,就把文件给拼到地址上