zoukankan      html  css  js  c++  java
  • Nginx文件服务器搭建

    一、Nginx安装

    1.yum安装

    cat >/etc/yum.repos.d/nginx.repo<<EOF
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/centos/7/x86_64
    gpgcheck=0
    enabled=1
    EOF
    

    2.官网rpm直接安装

    wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.12.1-1.el7.ngx.x86_64.rpm
    rpm -ivh nginx-1.12.1-1.el7.ngx.x86_64.rpm
    

    二、新增配置Nginx

    /etc/nginx/conf.d/fileserver.conf

    server {
        listen              53229;
        server_name         127.0.0.1;
        access_log    /var/log/nginx/files.log;
        include "/etc/nginx/conf.d/fileserver-location.tmp";
    }
    

    /etc/nginx/conf.d/fileserver-location

    location / {
        root              /usr/share/nginx/;
        autoindex on;
        #auth_request /auth;
        allow             all;
        deny              all;
        # A special location that doesn't require authentication for agents upgrade
    }
    

    三、重启Nginx

    systemctl restart nginx
    
  • 相关阅读:
    练习5.6.3节
    size_t
    练习3.43
    use include to read a file
    ACM数学(转)
    POJ 2039 To and Fro
    poj 1716 差分约束
    poj 3159 差分约束
    hdu 4571 floyd+动态规划
    poj 1364 差分约束
  • 原文地址:https://www.cnblogs.com/Ghostant/p/14749698.html
Copyright © 2011-2022 走看看