zoukankan      html  css  js  c++  java
  • 通过nginx制作类似阿里云镜像下载的网站

      一、创建下载文件存放的目录

    mkdir /data/site1/download

      二、将被访问的源放到这个目录里

    mount /dev/sr0 /data/site1/download/

      三、启用autoindex_module

    server {
            access_log /var/log/nginx/a.net.log access_json;
            server_name www.a.net;
            root /data/site1;
            location / {
            }
            location /admin {
                    root /data/;
                    auth_basic "Admin Page";
                    auth_basic_user_file /etc/nginx/conf.d/.nginx_passwd;
            }
            location /download {
                    autoindex on;
                    autoindex_exact_size off;
                    autoindex_localtime on;
                    limit_rate 100k;
                    index index.html;
            }
    }

    配置文件下载服务:

      启用autoindex模块,自动文件索引功能,默为off

     autoindex on 

      计算文件确切大小(单位bytes),off 显示大概大小(单位K、M),默认on

    autoindex_exact_size on | off;

      显示本机时间而非GMT(格林威治)时间,默认off

    autoindex_localtime on | off ;

      显示索引的页面文件风格,默认html

    autoindex_format html | xml | json | jsonp;


      

      

      

    ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------- 博客均为个人笔记,无所追求,仅供参考~~~ QQ--2382990774
  • 相关阅读:
    1、编写一个简单的C++程序
    96. Unique Binary Search Trees
    python 操作redis
    json.loads的一个很有意思的现象
    No changes detected
    leetcode 127 wordladder
    django uwsgi websocket踩坑
    you need to build uWSGI with SSL support to use the websocket handshake api function !!!
    pyinstaller 出现str error
    数据库的读现象
  • 原文地址:https://www.cnblogs.com/alexlv/p/14841954.html
Copyright © 2011-2022 走看看