zoukankan      html  css  js  c++  java
  • Nginx之使用nginx搭建简单的文件服务器

      使用nginx可以搭建简单文件服务器

      安装nginx(不详述)  

      修改配置文件

    /usr/local/nginx/conf/nginx.conf
    

      

    user  root;
    worker_processes  1;
    #error_log  logs/error.log;
    #pid        logs/nginx.pid;
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
        #access_log  logs/access.log  main;
        sendfile        on;
        keepalive_timeout  65;
        include  ./conf.d/*.conf;
    }
    

      文件配置文件

    autoindex on;# 显示目录
    autoindex_exact_size on;# 显示文件大小
    autoindex_localtime on;# 显示文件时间
    server {
        listen       80;
        server_name  172.16.90.13;
        root         /data/file;
    }
    

      创建根目录文件夹并且放入几个文件

      web页面访问查看,单击文件即可下载

  • 相关阅读:
    指针、字符串、数组操作
    字符串转换为数字(str2int)
    新的,开始。
    Hello, World.
    Go语言趣学指南lesson1
    hdoj2058
    poj2378
    hdoj1233
    poj2398
    hdoj1392
  • 原文地址:https://www.cnblogs.com/minseo/p/10655339.html
Copyright © 2011-2022 走看看