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页面访问查看,单击文件即可下载

  • 相关阅读:
    Strust2学习笔记
    EL与OGNL区别
    十进制与其他进制转换
    JSTL
    <jsp:include>和<%@include%>区别
    AngularJS 内置过滤器
    ubuntu下swift安装
    ubuntu下gerrit 安装部署
    java日期操作
    SpringMVC GET请求中文数据传递到Server端乱码
  • 原文地址:https://www.cnblogs.com/minseo/p/10655339.html
Copyright © 2011-2022 走看看