首页 > 系统相关 >nginx安装,upstream配置

nginx安装,upstream配置

时间:2022-11-27 14:23:23浏览次数:34  
标签:index 192.168 server nginx html location upstream 安装

nginx 安装和 upstream 配置

安装

  • 系统

centos7.9

相关命令

yum install -y pcre zlib openssl
yum install -y pcre-devel openssl-devel zlib-devel

./configure
make
make install

upstream 配置

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    upstream a {
        server 192.168.10.160:8000 weight=1;
        server 192.168.10.160:8001 weight=1;
    }

    upstream b {
        server 192.168.10.160:8000 weight=1;
    }

    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }
        location /a/ {
            proxy_pass http://a/;
            # 结尾的斜杠 / 代表截断 /a/ 向后传递 ,不带的话 /a 向后传递
            #  /a/api/user
            #  /api/user
        }
        location /b/ {
            proxy_pass http://b/;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

调用示例

  • [upstream 调用示例 ]

标签:index,192.168,server,nginx,html,location,upstream,安装
From: https://www.cnblogs.com/--just-lbk/p/16929586.html

相关文章

  • Centos7安装与使用
    1.问题描述在Windows下,使用VMware安装Centos72.版本介绍Centos镜像列表:http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS7版本说明大小CentO......
  • redis 安装报错 jemalloc/jemalloc.h: No such file or directory
    redis第一次编译的时候没有gcc工具报错安装完gcc后再次编译就报错:"jemalloc/jemalloc.h:Nosuchfileordirectory"正确解决办法(针对2.2以上的版本)清理上次编译残留文件......
  • 安装torch_scatter,torch-sparse,torch-cluster,torch-spline-conv,torch-geometric
    1.查询torch版本号进入https://pytorch-geometric.com/whl/找到对应的torch版本>>点击进入   2.找到匹配的包  点击下载即可 3.使用pip离线安装pip......
  • 在 VirtualBox 中安装 Ubuntu
    每次更换电脑,需要安装虚拟机的时候,都要去搜别人的教程,干脆自己把安装过程记录下来,方便后面的参考。(一)下载Ubuntu我使用的是ubuntu16ubuntu官网下载地址:https://r......
  • R包本地安装方法
    问题需要安装一个R的测试包但是这个包没有在cran中也没有在biomanager中于是决定使用devtools-github安装遇到问题无法下载github上的R包策略使用local方法安装......
  • 适用于 Linux 的 Windows 子系统(WSL)安装指南
    (目录)WindowsSubsystemforLinuxWSL提供了一个微软开发的Linux兼容内核接口(不包含Linux代码),来自Ubuntu的用户模式二进制文件在其上运行。简单来说就是用Linux系统去......
  • MySQL 5.6/8.0 zip 安装
    MySQL5.7/8.0zip先安装rem配置系统环境变量Path中添加mysql.zip\bincd/dmysql.zip\binrem本地root密码为空mysqld--initialize-insecuremysqldinstallnet......
  • Cent 7 安装 tilde 文本编辑器
    cd/etc/yum.repos.dwget http://download.opensuse.org/repositories/home:/gphalkes:/tilde/CentOS_CentOS-7/home:gphalkes:tilde.repomvhome:gphalkes:tilde.repo......
  • Nodejs简单方式安装至centos
    1.官网 下载编译好的包官网下载:下载|Node.js中文网(nodejs.cn)cd/usr/localwgethttps://npmmirror.com/mirrors/node/v16.18.1/node-v16.18.1-linux-x64.tar.xz......
  • 最新版gym-0.26.2下Atari环境的安装以及环境版本v0,v4,v5的说明
    强化学习的游戏仿真环境可以分为连续控制和非连续控制两类,其中连续控制的以mujoco为主,而非连续控制的以Atari游戏为主,本文对gym下的Atari环境的游戏环境版本进行一定的介绍......