首页 > 代码库 > nginx 做下载服务器

nginx 做下载服务器

参考配置

events {     worker_connections 65535;  use epoll; }   http {  log_format f_nginx  "$remote_addr`$server_addr`$server_protocol`$request_method`$server_port`$bytes_sent`$uri`?$query_string`$status`$request_time`[$time_local]`$http_referer`$http_user_agent";    sendfile on;  tcp_nopush on;  tcp_nodelay on;  keepalive_timeout 60;  types_hash_max_size 2048;    server_names_hash_bucket_size 128;  client_header_buffer_size 4;    client_header_timeout 60;  client_body_timeout 60;  large_client_header_buffers 16 512k;  #client_body_buffer_size   256k;  client_max_body_size      10m;    include /etc/nginx/mime.types;  default_type application/octet-stream;    access_log /var/log/nginx/access.log;  error_log /var/log/nginx/error.log;    gzip  on;  gzip_min_length  1024;  gzip_buffers     16 32k;  gzip_proxied     any;  gzip_types       text/plain application/x-javascript text/css application/xml text/javascript;    limit_zone ltone $binary_remote_addr 10m;  server {  listen   80;  server_name test.com;    access_log  /test/access.log;  error_log /test/error.log;      root /test;  index index.htm;  limit_conn  10;  limit_rate 50k; 
#是否支持读取目录 autoindex on; sendfile on; tcp_nopush on; expires 365d; location
^~/testdown/ { root /test; limit_rate 800k; autoindex on; sendfile on; tcp_nopush on; rewrite ^(.*)$ /test.gz break; } } }

 

nginx 做下载服务器