Nginx学习

一、Nginx三大功能:反向代理、动静分离、负载均衡

二、反向代理

  A、proxy_pass: http://....

三、负载均衡

  A、基本配置

    1. http块

      upstream 名字 {

        服务器列表...

      }

    2. location块

      location / {

        proxy_pass:http://名字

      }

四、动静分离

  A、基本配置

    1. location /文件夹名/ {

      root: /上一级文件夹名/,

      autoindex on //是否显示文件索引

      index: ...

    }

五、高可用

  A、准备工作

    1. 两台服务器

    2. 都安装nginx

    3. 都安装keepalived

posted on 2019-11-04 23:21  DjanFey  阅读(93)  评论(0编辑  收藏  举报

导航