nginx 부하 균형 단순 설정

자신 이 계속 개선 해 야 할 것 을 간단하게 지 켰 다.
user nobody;
worker_processes  auto;
events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  3600;

    upstream webservers {
        sticky;
        server 10.3.110.60:5200;
        server 10.3.110.61:5200;
    }

    server {
        listen       5400;
        server_name  localhost;
        root         /usr/share/nginx/html;
        proxy_buffer_size   128k;
        proxy_buffers   4 256k;
        proxy_busy_buffers_size   256k;
        proxy_set_header        Host            $http_host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        location /
        {
            add_header 'Access-Control-Allow-Origin' "$http_origin";
            add_header 'Access-Control-Allow-Credentials' "true";
            proxy_pass http://webservers;
         }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

좋은 웹페이지 즐겨찾기