很簡單的一個配置,不指定為啥,別人寫的都好麻煩,而且很多配置了也不行,明明就是幾句話的事啊,唉。
話不多說,直接上配置
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;}}
}
沒錯,這就完事了,沒有多余配置,訪問直接就可以訪問到了
如果想直接下載,就把文件給拼到地址上