zoukankan      html  css  js  c++  java
  • nginx 做下载服务器

    参考配置

    events {   
     
     worker_connections 1;
     
     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; } } }
  • 相关阅读:
    xml解析模块
    python面向对象基础
    python hashlib模块
    os和sys模块
    python反射
    正则表达式re模块
    踩的python列表及for循环一个坑儿
    python序列化模块json和pickle
    python时间模块-time和datetime
    64匹马、8赛道,至少多少轮比赛找出速度最快的4匹马?
  • 原文地址:https://www.cnblogs.com/jrsun/p/3986422.html
Copyright © 2011-2022 走看看