Negix

 

Negix反向代理、负载均衡

negix.conf 文件配置

worker_processes  1;



events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

#负载均衡
#1,设置代理地址,将代理地址给到下面location
    upstream proxyDomain {
    server 127.0.0.1:8080 weight=1;
    server 127.0.0.1:8081 weight=1;
    }

#反向代理
    server {
        listen       80;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
        #2,添加一个代理地址
        proxy_pass http://proxyDomain;

        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }


}

 

posted @ 2022-03-21 15:56  龙龙鄂构  阅读(159)  评论(0编辑  收藏  举报