• nginx反向代理三台web服务器,实现负载均衡


    修改nginx.conf

    #在http和server之间加入这个模块 
    upstream guaji{
    server 127.0.0.1:8080;
    server 127.0.0.2:8080;
    server 127.0.0.3:8080; }

    nginx.conf的server

    server {
      listen 80;
      server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
       proxy_pass http://guaji;
        # root html;
        #index index.html index.htm; }
    }
    修改nginx1.conf
    server {
            listen       8080;
    server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html;
    index index.html index.htm; }
    }

    修改nginx.conf(第二个从机)

    server {
    listen 8080;#只修改这里
    server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
    root html;
    index index.html index.htm; }
    }

    同理修改第三个从机的nginx.conf

    修改index.html

    然后重启就ok

  • 相关阅读:
    函数指针与变长参数列表
    Finding intersection and union of two sets.
    依赖注入
    可达性分析算法
    java 虚拟机栈
    Java 堆
    java虚拟机>>程序计数器
    Java方法区(Method Area)
    Java 运行时常量池
    java引用
  • 原文地址:https://www.cnblogs.com/ldcheng/p/9203978.html
Copyright © 2020-2023  润新知