NGINX+ - LB & Dashboard

  • 기본 LB 구성
  • Dashboard Monitoring

Prepare - Lab File Upload

NGINX Plus Config

  • /etc/nginx/conf.d/lb.conf

    upstream backend_servers {
        zone backend_server_zone 64k;
        server 127.0.0.1:9001;
        server 127.0.0.1:9002;
    }
    server {
        listen 9000;
        autoindex on;
    
        location / {
        proxy_pass http://backend_servers/;
    
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        }
    }
    
  • /etc/nginx/conf.d/dashboard.conf

    server {
        listen       8090;
            location /api {
            api write=on;
            allow all;
        }
        location / {
        root /usr/share/nginx/html;
        index   dashboard.html;
        }
    }
    

NGINX Plus - LB Service Check

  • nginx -s reload

  • curl IP:9000

    • Backend Server (9001 / 9002 번갈아 가면서 확인 )
  • Capture

NGINX Plus - Dashboard Check

  • curl IP:8090/dashboard.html
  • Capture