码迷,mamicode.com
首页 > 其他好文 > 详细

nginx 做下载服务器

时间:2014-09-22 18:54:13      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   java   ar   for   div   

参考配置

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 做下载服务器

标签:style   blog   http   color   io   java   ar   for   div   

原文地址:http://www.cnblogs.com/jrsun/p/3986422.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!