zoukankan      html  css  js  c++  java
  • nginx 多个网站配置

    iis时此时有多个网站,nginx.conf两种配置方式

    第一种:直接配置在nginx.conf中

    在nginx.conf中新增配置

    http节点下新增:

    upstream weba{ 
    		server 39.xxx.xxx.xxx:8032; 
    	}
    upstream webb{ 
    		server 39.xxx.xxx.xxx:8033; 
    	}
    server {
            listen       10171;
            server_name  localhost;
            location / {
    		     proxy_pass http://weba;
            }
        }
    server {
            listen       10172;
            server_name  localhost;
            location / {
    		     proxy_pass http://webb;
            }
        }

    第二种新增配置文件:

    新建cuswebconf文件夹,并在此文件夹中新增文件weba.conf、webb.conf

    weba.conf

    upstream weba{  
    		server 39.xxx.xxx.xxx:8032 weight=1;
    	}
        server {
            listen       10171;
            server_name  localhost;
            location / {
    			proxy_pass http://weba;
            }
        }
    

    webb.conf

    upstream webb{  
    		server 39.xxx.xxx.xxx:8032 weight=1;
    	}
        server {
            listen       10172;
            server_name  localhost;
            location / {
    			proxy_pass http://webb;
            }
        }

    nginx.conf文件中http节点新增

    include  cuswebconf/*.conf;
    

     

  • 相关阅读:
    51串口通信
    juicer使用备忘
    51单片机音乐盒程序
    最精简24L01程序--接收
    sqlserver 数据库迁移
    sqlserver自增主键
    js keycode
    tabindex 去掉虚线
    div 绑定keyup
    sqlserver 当前时间减去30天
  • 原文地址:https://www.cnblogs.com/xiao-sheng/p/15416414.html
Copyright © 2011-2022 走看看