nginx负载均衡与反向代理配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Android_Mrchen/article/details/84100222
upstream 193.168.81.128{
    server localhost:8080 weight=1 max_fails=2 fail_timeout=30s;
    server localhost:8081 weight=1 max_fails=2 fail_timeout=30s;
    keepalive 300; # 300个长连接
    }

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;
    location / {
       # root   /usr/share/nginx/html;
       # index  index.html index.htm;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_pass http://192.168.81.128;
    }
}


 

猜你喜欢

转载自blog.csdn.net/Android_Mrchen/article/details/84100222