[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P8AM6BY44ZJX546KKPGD45":3,"skill-same:01M6P8AM6BY44ZJX546KKPGD45":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":29,"commitSha":52,"skillDirectory":53,"forksCount":13,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M6P8AM6BY44ZJX546KKPGD45","load-balancing",null,"Configure load balancers and traffic distribution. Implement health checks and SSL termination. Use when distributing traffic across servers.","duc-duy-1612\u002FOnline-Delivery-Systems-Web","duc-duy-1612","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192231384?v=4","01M6NSDKQQDKVTHZ8DZMZ1VYY6","01M6NSDKW8DDVTQHBT1HBDDJPT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fload-balancing\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"load","load balancing","across","traffic","relevant","scripts","critical","os","distribution","platform","security","main","community","agent-skills","only","use","configure","access","devops-security","license","2026-11-10 10:12:30",false,"---\nname: load-balancing\ndescription: Configure load balancers and traffic distribution. Implement health checks\n  and SSL termination. Use when distributing traffic across servers.\ncategory: devops\nrisk: critical\nsource: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\nsource_repo: BagelHole\u002FDevOps-Security-Agent-Skills\nsource_type: community\ndate_added: '2026-09-20'\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE\ncompatibility: Requires the relevant OS\u002Fplatform tooling and privileged access where\n  noted. Docs-only; helper scripts and templates not bundled.\nmetadata:\n  author: devops-skills\n  version: '1.0'\n---\n\n# Load Balancing\n\nDistribute traffic across application servers for high availability, scalability, and fault tolerance.\n\n## When to Use\n\n- Distributing HTTP\u002FHTTPS traffic across multiple backend servers.\n- Implementing health checks to route around unhealthy instances.\n- Terminating TLS at the load balancer for simplified certificate management.\n- Enabling blue\u002Fgreen or canary deployments with traffic shifting.\n- Scaling horizontally behind a single entry point.\n\n## Prerequisites\n\n- Two or more backend servers running the same application.\n- TLS certificate for HTTPS termination (ACM, Let's Encrypt, or self-signed for internal).\n- For AWS: VPC with public and private subnets across availability zones.\n- For nginx\u002FHAProxy: Linux server with root access.\n\n## nginx Load Balancer\n\n### Basic Round-Robin\n\n```nginx\n# \u002Fetc\u002Fnginx\u002Fconf.d\u002Floadbalancer.conf\nupstream app_backend {\n    server 10.0.1.10:8080;\n    server 10.0.1.11:8080;\n    server 10.0.1.12:8080;\n}\n\nserver {\n    listen 80;\n    server_name app.example.com;\n    return 301 https:\u002F\u002F$host$request_uri;\n}\n\nserver {\n    listen 443 ssl http2;\n    server_name app.example.com;\n\n    ssl_certificate     \u002Fetc\u002Fssl\u002Fcerts\u002Fapp.example.com.pem;\n    ssl_certificate_key \u002Fetc\u002Fssl\u002Fprivate\u002Fapp.example.com-key.pem;\n    ssl_protocols       TLSv1.2 TLSv1.3;\n    ssl_ciphers         HIGH:!aNULL:!MD5;\n\n    location \u002F {\n        proxy_pass http:\u002F\u002Fapp_backend;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n\n        proxy_connect_timeout 5s;\n        proxy_read_timeout 30s;\n        proxy_send_timeout 30s;\n    }\n\n    location \u002Fhealth {\n        access_log off;\n        return 200 \"OK\";\n    }\n}\n```\n\n### Weighted and Backup Servers\n\n```nginx\nupstream app_backend {\n    least_conn;  # Route to server with fewest active connections\n\n    server 10.0.1.10:8080 weight=5;      # Gets 5x traffic\n    server 10.0.1.11:8080 weight=3;      # Gets 3x traffic\n    server 10.0.1.12:8080 weight=1;      # Gets 1x traffic\n    server 10.0.1.20:8080 backup;        # Only used when others are down\n    server 10.0.1.21:8080 down;          # Temporarily removed from pool\n}\n```\n\n### Health Checks (nginx Plus \u002F OpenResty)\n\n```nginx\nupstream app_backend {\n    zone backend 64k;  # Shared memory zone for health data\n\n    server 10.0.1.10:8080;\n    server 10.0.1.11:8080;\n    server 10.0.1.12:8080;\n}\n\n# Health check (requires nginx Plus or third-party module)\n# match healthy {\n#     status 200;\n#     body ~ \"OK\";\n# }\n# health_check interval=5s fails=3 passes=2 match=healthy;\n```\n\n### Sticky Sessions (IP Hash)\n\n```nginx\nupstream app_backend {\n    ip_hash;  # Same client IP always goes to the same server\n    server 10.0.1.10:8080;\n    server 10.0.1.11:8080;\n    server 10.0.1.12:8080;\n}\n```\n\n## HAProxy Configuration\n\n### Full Production Config\n\n```\n# \u002Fetc\u002Fhaproxy\u002Fhaproxy.cfg\nglobal\n    log \u002Fdev\u002Flog local0\n    maxconn 4096\n    daemon\n    ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256\n    ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11\n    tune.ssl.default-dh-param 2048\n\ndefaults\n    mode http\n    log global\n    option httplog\n    option dontlognull\n    option forwardfor\n    timeout connect 5s\n    timeout client  30s\n    timeout server  30s\n    timeout http-request 10s\n    timeout http-keep-alive 5s\n    retries 3\n\nfrontend http_front\n    bind *:80\n    redirect scheme https code 301 if !{ ssl_fc }\n\nfrontend https_front\n    bind *:443 ssl crt \u002Fetc\u002Fssl\u002Fcerts\u002Fapp.example.com.pem\n    http-request set-header X-Forwarded-Proto https\n\n    # Route based on path\n    acl is_api path_beg \u002Fapi\u002F\n    acl is_ws  path_beg \u002Fws\u002F\n\n    use_backend api_servers if is_api\n    use_backend ws_servers  if is_ws\n    default_backend web_servers\n\nbackend web_servers\n    balance roundrobin\n    option httpchk GET \u002Fhealth HTTP\u002F1.1\\r\\nHost:\\ app.example.com\n    http-check expect status 200\n\n    cookie SERVERID insert indirect nocache\n    server web1 10.0.1.10:8080 check inter 5s fall 3 rise 2 cookie web1\n    server web2 10.0.1.11:8080 check inter 5s fall 3 rise 2 cookie web2\n    server web3 10.0.1.12:8080 check inter 5s fall 3 rise 2 cookie web3\n\nbackend api_servers\n    balance leastconn\n    option httpchk GET \u002Fapi\u002Fhealth\n    http-check expect status 200\n\n    server api1 10.0.2.10:8080 check inter 5s fall 3 rise 2\n    server api2 10.0.2.11:8080 check inter 5s fall 3 rise 2\n\nbackend ws_servers\n    balance source\n    option httpchk GET \u002Fhealth\n    timeout tunnel 1h\n\n    server ws1 10.0.3.10:8080 check inter 5s fall 3 rise 2\n    server ws2 10.0.3.11:8080 check inter 5s fall 3 rise 2\n\nlisten stats\n    bind *:8404\n    stats enable\n    stats uri \u002Fstats\n    stats refresh 10s\n    stats admin if LOCALHOST\n```\n\n### HAProxy Management\n\n```bash\n# Test config before reloading\nhaproxy -c -f \u002Fetc\u002Fhaproxy\u002Fhaproxy.cfg\n\n# Reload without dropping connections\nsudo systemctl reload haproxy\n\n# View stats from CLI\necho \"show stat\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n\n# Drain a server (stop new connections, let existing finish)\necho \"set server web_servers\u002Fweb1 state drain\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n\n# Set server to maintenance\necho \"set server web_servers\u002Fweb1 state maint\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n\n# Re-enable server\necho \"set server web_servers\u002Fweb1 state ready\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n```\n\n## AWS Application Load Balancer (ALB)\n\n### Create ALB via CLI\n\n```bash\n# Create the load balancer\naws elbv2 create-load-balancer \\\n  --name my-app-alb \\\n  --subnets subnet-aaa111 subnet-bbb222 \\\n  --security-groups sg-xxx123 \\\n  --type application \\\n  --scheme internet-facing\n\n# Create a target group\naws elbv2 create-target-group \\\n  --name my-app-targets \\\n  --protocol HTTP \\\n  --port 8080 \\\n  --vpc-id vpc-xxx123 \\\n  --health-check-protocol HTTP \\\n  --health-check-path \u002Fhealth \\\n  --health-check-interval-seconds 15 \\\n  --healthy-threshold-count 2 \\\n  --unhealthy-threshold-count 3 \\\n  --target-type instance\n\n# Register targets\naws elbv2 register-targets \\\n  --target-group-arn arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup\u002Fmy-app-targets\u002Fabc123 \\\n  --targets Id=i-0123456789abc Id=i-0987654321def\n\n# Create HTTPS listener\naws elbv2 create-listener \\\n  --load-balancer-arn arn:aws:elasticloadbalancing:us-east-1:123456:loadbalancer\u002Fapp\u002Fmy-app-alb\u002Fabc123 \\\n  --protocol HTTPS \\\n  --port 443 \\\n  --certificates CertificateArn=arn:aws:acm:us-east-1:123456:certificate\u002Fabc-123 \\\n  --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup\u002Fmy-app-targets\u002Fabc123\n\n# Create HTTP redirect listener\naws elbv2 create-listener \\\n  --load-balancer-arn arn:aws:elasticloadbalancing:us-east-1:123456:loadbalancer\u002Fapp\u002Fmy-app-alb\u002Fabc123 \\\n  --protocol HTTP \\\n  --port 80 \\\n  --default-actions Type=redirect,RedirectConfig='{Protocol=HTTPS,Port=443,StatusCode=HTTP_301}'\n```\n\n### Check Target Health\n\n```bash\n# Check health of registered targets\naws elbv2 describe-target-health \\\n  --target-group-arn arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup\u002Fmy-app-targets\u002Fabc123\n```\n\n## AWS Network Load Balancer (NLB)\n\n```bash\n# Create NLB (for TCP, UDP, or TLS traffic)\naws elbv2 create-load-balancer \\\n  --name my-tcp-nlb \\\n  --subnets subnet-aaa111 subnet-bbb222 \\\n  --type network \\\n  --scheme internet-facing\n\n# Create TCP target group\naws elbv2 create-target-group \\\n  --name my-tcp-targets \\\n  --protocol TCP \\\n  --port 5432 \\\n  --vpc-id vpc-xxx123 \\\n  --health-check-protocol TCP \\\n  --target-type ip\n```\n\n## ALB with Terraform\n\n```hcl\nresource \"aws_lb\" \"app\" {\n  name               = \"my-app-alb\"\n  internal           = false\n  load_balancer_type = \"application\"\n  security_groups    = [aws_security_group.alb.id]\n  subnets            = var.public_subnet_ids\n\n  enable_deletion_protection = true\n}\n\nresource \"aws_lb_target_group\" \"app\" {\n  name     = \"my-app-tg\"\n  port     = 8080\n  protocol = \"HTTP\"\n  vpc_id   = var.vpc_id\n\n  health_check {\n    path                = \"\u002Fhealth\"\n    port                = \"traffic-port\"\n    healthy_threshold   = 2\n    unhealthy_threshold = 3\n    timeout             = 5\n    interval            = 15\n    matcher             = \"200\"\n  }\n\n  deregistration_delay = 30\n\n  stickiness {\n    type            = \"lb_cookie\"\n    cookie_duration = 86400\n    enabled         = true\n  }\n}\n\nresource \"aws_lb_listener\" \"https\" {\n  load_balancer_arn = aws_lb.app.arn\n  port              = 443\n  protocol          = \"HTTPS\"\n  ssl_policy        = \"ELBSecurityPolicy-TLS13-1-2-2021-06\"\n  certificate_arn   = aws_acm_certificate.cert.arn\n\n  default_action {\n    type             = \"forward\"\n    target_group_arn = aws_lb_target_group.app.arn\n  }\n}\n\nresource \"aws_lb_listener\" \"http_redirect\" {\n  load_balancer_arn = aws_lb.app.arn\n  port              = 80\n  protocol          = \"HTTP\"\n\n  default_action {\n    type = \"redirect\"\n    redirect {\n      port        = \"443\"\n      protocol    = \"HTTPS\"\n      status_code = \"HTTP_301\"\n    }\n  }\n}\n```\n\n## Load Balancing Algorithms\n\n| Algorithm | Use Case | nginx | HAProxy |\n|-----------|----------|-------|---------|\n| Round Robin | Default, equal servers | `(default)` | `balance roundrobin` |\n| Least Connections | Uneven request durations | `least_conn` | `balance leastconn` |\n| IP Hash | Session persistence without cookies | `ip_hash` | `balance source` |\n| URI Hash | Cache locality per URL | `hash $request_uri` | `balance uri` |\n| Random with Two | Large server pools | `random two least_conn` | `balance random(2)` |\n\n## Troubleshooting\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| All backends show \"unhealthy\" | Health check path returns non-200 | Verify `\u002Fhealth` endpoint returns 200; check security groups |\n| 502 Bad Gateway | Backend not running or wrong port | Confirm backend is listening on the configured port |\n| Uneven traffic distribution | Sticky sessions or weighted config | Check session affinity settings; review server weights |\n| Connection timeouts | Backend too slow or timeout too low | Increase `proxy_read_timeout` or HAProxy `timeout server` |\n| TLS handshake failures | Certificate mismatch or expired cert | Verify cert matches the domain; renew if expired |\n| ALB returns 503 | No healthy targets registered | Check target group health; verify targets are in correct subnets |\n| WebSocket disconnects | Proxy not configured for upgrades | Add `proxy_set_header Upgrade` and `Connection \"upgrade\"` |\n\n## Related Skills\n\n- reverse-proxy (`reverse-proxy`) - Reverse proxy configuration patterns\n- dns-management (`dns-management`) - DNS records pointing to load balancers\n- cdn-setup (`cdn-setup`) - CDN in front of load balanced origins\n- service-mesh (`service-mesh`) - Service-level load balancing in Kubernetes\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n","# Load Balancing\n\nDistribute traffic across application servers for high availability, scalability, and fault tolerance.\n\n## When to Use\n\n- Distributing HTTP\u002FHTTPS traffic across multiple backend servers.\n- Implementing health checks to route around unhealthy instances.\n- Terminating TLS at the load balancer for simplified certificate management.\n- Enabling blue\u002Fgreen or canary deployments with traffic shifting.\n- Scaling horizontally behind a single entry point.\n\n## Prerequisites\n\n- Two or more backend servers running the same application.\n- TLS certificate for HTTPS termination (ACM, Let's Encrypt, or self-signed for internal).\n- For AWS: VPC with public and private subnets across availability zones.\n- For nginx\u002FHAProxy: Linux server with root access.\n\n## nginx Load Balancer\n\n### Basic Round-Robin\n\n```nginx\n# \u002Fetc\u002Fnginx\u002Fconf.d\u002Floadbalancer.conf\nupstream app_backend {\n    server 10.0.1.10:8080;\n    server 10.0.1.11:8080;\n    server 10.0.1.12:8080;\n}\n\nserver {\n    listen 80;\n    server_name app.example.com;\n    return 301 https:\u002F\u002F$host$request_uri;\n}\n\nserver {\n    listen 443 ssl http2;\n    server_name app.example.com;\n\n    ssl_certificate     \u002Fetc\u002Fssl\u002Fcerts\u002Fapp.example.com.pem;\n    ssl_certificate_key \u002Fetc\u002Fssl\u002Fprivate\u002Fapp.example.com-key.pem;\n    ssl_protocols       TLSv1.2 TLSv1.3;\n    ssl_ciphers         HIGH:!aNULL:!MD5;\n\n    location \u002F {\n        proxy_pass http:\u002F\u002Fapp_backend;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n\n        proxy_connect_timeout 5s;\n        proxy_read_timeout 30s;\n        proxy_send_timeout 30s;\n    }\n\n    location \u002Fhealth {\n        access_log off;\n        return 200 \"OK\";\n    }\n}\n```\n\n### Weighted and Backup Servers\n\n```nginx\nupstream app_backend {\n    least_conn;  # Route to server with fewest active connections\n\n    server 10.0.1.10:8080 weight=5;      # Gets 5x traffic\n    server 10.0.1.11:8080 weight=3;      # Gets 3x traffic\n    server 10.0.1.12:8080 weight=1;      # Gets 1x traffic\n    server 10.0.1.20:8080 backup;        # Only used when others are down\n    server 10.0.1.21:8080 down;          # Temporarily removed from pool\n}\n```\n\n### Health Checks (nginx Plus \u002F OpenResty)\n\n```nginx\nupstream app_backend {\n    zone backend 64k;  # Shared memory zone for health data\n\n    server 10.0.1.10:8080;\n    server 10.0.1.11:8080;\n    server 10.0.1.12:8080;\n}\n\n# Health check (requires nginx Plus or third-party module)\n# match healthy {\n#     status 200;\n#     body ~ \"OK\";\n# }\n# health_check interval=5s fails=3 passes=2 match=healthy;\n```\n\n### Sticky Sessions (IP Hash)\n\n```nginx\nupstream app_backend {\n    ip_hash;  # Same client IP always goes to the same server\n    server 10.0.1.10:8080;\n    server 10.0.1.11:8080;\n    server 10.0.1.12:8080;\n}\n```\n\n## HAProxy Configuration\n\n### Full Production Config\n\n```\n# \u002Fetc\u002Fhaproxy\u002Fhaproxy.cfg\nglobal\n    log \u002Fdev\u002Flog local0\n    maxconn 4096\n    daemon\n    ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256\n    ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11\n    tune.ssl.default-dh-param 2048\n\ndefaults\n    mode http\n    log global\n    option httplog\n    option dontlognull\n    option forwardfor\n    timeout connect 5s\n    timeout client  30s\n    timeout server  30s\n    timeout http-request 10s\n    timeout http-keep-alive 5s\n    retries 3\n\nfrontend http_front\n    bind *:80\n    redirect scheme https code 301 if !{ ssl_fc }\n\nfrontend https_front\n    bind *:443 ssl crt \u002Fetc\u002Fssl\u002Fcerts\u002Fapp.example.com.pem\n    http-request set-header X-Forwarded-Proto https\n\n    # Route based on path\n    acl is_api path_beg \u002Fapi\u002F\n    acl is_ws  path_beg \u002Fws\u002F\n\n    use_backend api_servers if is_api\n    use_backend ws_servers  if is_ws\n    default_backend web_servers\n\nbackend web_servers\n    balance roundrobin\n    option httpchk GET \u002Fhealth HTTP\u002F1.1\\r\\nHost:\\ app.example.com\n    http-check expect status 200\n\n    cookie SERVERID insert indirect nocache\n    server web1 10.0.1.10:8080 check inter 5s fall 3 rise 2 cookie web1\n    server web2 10.0.1.11:8080 check inter 5s fall 3 rise 2 cookie web2\n    server web3 10.0.1.12:8080 check inter 5s fall 3 rise 2 cookie web3\n\nbackend api_servers\n    balance leastconn\n    option httpchk GET \u002Fapi\u002Fhealth\n    http-check expect status 200\n\n    server api1 10.0.2.10:8080 check inter 5s fall 3 rise 2\n    server api2 10.0.2.11:8080 check inter 5s fall 3 rise 2\n\nbackend ws_servers\n    balance source\n    option httpchk GET \u002Fhealth\n    timeout tunnel 1h\n\n    server ws1 10.0.3.10:8080 check inter 5s fall 3 rise 2\n    server ws2 10.0.3.11:8080 check inter 5s fall 3 rise 2\n\nlisten stats\n    bind *:8404\n    stats enable\n    stats uri \u002Fstats\n    stats refresh 10s\n    stats admin if LOCALHOST\n```\n\n### HAProxy Management\n\n```bash\n# Test config before reloading\nhaproxy -c -f \u002Fetc\u002Fhaproxy\u002Fhaproxy.cfg\n\n# Reload without dropping connections\nsudo systemctl reload haproxy\n\n# View stats from CLI\necho \"show stat\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n\n# Drain a server (stop new connections, let existing finish)\necho \"set server web_servers\u002Fweb1 state drain\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n\n# Set server to maintenance\necho \"set server web_servers\u002Fweb1 state maint\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n\n# Re-enable server\necho \"set server web_servers\u002Fweb1 state ready\" | sudo socat stdio \u002Fvar\u002Frun\u002Fhaproxy\u002Fadmin.sock\n```\n\n## AWS Application Load Balancer (ALB)\n\n### Create ALB via CLI\n\n```bash\n# Create the load balancer\naws elbv2 create-load-balancer \\\n  --name my-app-alb \\\n  --subnets subnet-aaa111 subnet-bbb222 \\\n  --security-groups sg-xxx123 \\\n  --type application \\\n  --scheme internet-facing\n\n# Create a target group\naws elbv2 create-target-group \\\n  --name my-app-targets \\\n  --protocol HTTP \\\n  --port 8080 \\\n  --vpc-id vpc-xxx123 \\\n  --health-check-protocol HTTP \\\n  --health-check-path \u002Fhealth \\\n  --health-check-interval-seconds 15 \\\n  --healthy-threshold-count 2 \\\n  --unhealthy-threshold-count 3 \\\n  --target-type instance\n\n# Register targets\naws elbv2 register-targets \\\n  --target-group-arn arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup\u002Fmy-app-targets\u002Fabc123 \\\n  --targets Id=i-0123456789abc Id=i-0987654321def\n\n# Create HTTPS listener\naws elbv2 create-listener \\\n  --load-balancer-arn arn:aws:elasticloadbalancing:us-east-1:123456:loadbalancer\u002Fapp\u002Fmy-app-alb\u002Fabc123 \\\n  --protocol HTTPS \\\n  --port 443 \\\n  --certificates CertificateArn=arn:aws:acm:us-east-1:123456:certificate\u002Fabc-123 \\\n  --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup\u002Fmy-app-targets\u002Fabc123\n\n# Create HTTP redirect listener\naws elbv2 create-listener \\\n  --load-balancer-arn arn:aws:elasticloadbalancing:us-east-1:123456:loadbalancer\u002Fapp\u002Fmy-app-alb\u002Fabc123 \\\n  --protocol HTTP \\\n  --port 80 \\\n  --default-actions Type=redirect,RedirectConfig='{Protocol=HTTPS,Port=443,StatusCode=HTTP_301}'\n```\n\n### Check Target Health\n\n```bash\n# Check health of registered targets\naws elbv2 describe-target-health \\\n  --target-group-arn arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup\u002Fmy-app-targets\u002Fabc123\n```\n\n## AWS Network Load Balancer (NLB)\n\n```bash\n# Create NLB (for TCP, UDP, or TLS traffic)\naws elbv2 create-load-balancer \\\n  --name my-tcp-nlb \\\n  --subnets subnet-aaa111 subnet-bbb222 \\\n  --type network \\\n  --scheme internet-facing\n\n# Create TCP target group\naws elbv2 create-target-group \\\n  --name my-tcp-targets \\\n  --protocol TCP \\\n  --port 5432 \\\n  --vpc-id vpc-xxx123 \\\n  --health-check-protocol TCP \\\n  --target-type ip\n```\n\n## ALB with Terraform\n\n```hcl\nresource \"aws_lb\" \"app\" {\n  name               = \"my-app-alb\"\n  internal           = false\n  load_balancer_type = \"application\"\n  security_groups    = [aws_security_group.alb.id]\n  subnets            = var.public_subnet_ids\n\n  enable_deletion_protection = true\n}\n\nresource \"aws_lb_target_group\" \"app\" {\n  name     = \"my-app-tg\"\n  port     = 8080\n  protocol = \"HTTP\"\n  vpc_id   = var.vpc_id\n\n  health_check {\n    path                = \"\u002Fhealth\"\n    port                = \"traffic-port\"\n    healthy_threshold   = 2\n    unhealthy_threshold = 3\n    timeout             = 5\n    interval            = 15\n    matcher             = \"200\"\n  }\n\n  deregistration_delay = 30\n\n  stickiness {\n    type            = \"lb_cookie\"\n    cookie_duration = 86400\n    enabled         = true\n  }\n}\n\nresource \"aws_lb_listener\" \"https\" {\n  load_balancer_arn = aws_lb.app.arn\n  port              = 443\n  protocol          = \"HTTPS\"\n  ssl_policy        = \"ELBSecurityPolicy-TLS13-1-2-2021-06\"\n  certificate_arn   = aws_acm_certificate.cert.arn\n\n  default_action {\n    type             = \"forward\"\n    target_group_arn = aws_lb_target_group.app.arn\n  }\n}\n\nresource \"aws_lb_listener\" \"http_redirect\" {\n  load_balancer_arn = aws_lb.app.arn\n  port              = 80\n  protocol          = \"HTTP\"\n\n  default_action {\n    type = \"redirect\"\n    redirect {\n      port        = \"443\"\n      protocol    = \"HTTPS\"\n      status_code = \"HTTP_301\"\n    }\n  }\n}\n```\n\n## Load Balancing Algorithms\n\n| Algorithm | Use Case | nginx | HAProxy |\n|-----------|----------|-------|---------|\n| Round Robin | Default, equal servers | `(default)` | `balance roundrobin` |\n| Least Connections | Uneven request durations | `least_conn` | `balance leastconn` |\n| IP Hash | Session persistence without cookies | `ip_hash` | `balance source` |\n| URI Hash | Cache locality per URL | `hash $request_uri` | `balance uri` |\n| Random with Two | Large server pools | `random two least_conn` | `balance random(2)` |\n\n## Troubleshooting\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| All backends show \"unhealthy\" | Health check path returns non-200 | Verify `\u002Fhealth` endpoint returns 200; check security groups |\n| 502 Bad Gateway | Backend not running or wrong port | Confirm backend is listening on the configured port |\n| Uneven traffic distribution | Sticky sessions or weighted config | Check session affinity settings; review server weights |\n| Connection timeouts | Backend too slow or timeout too low | Increase `proxy_read_timeout` or HAProxy `timeout server` |\n| TLS handshake failures | Certificate mismatch or expired cert | Verify cert matches the domain; renew if expired |\n| ALB returns 503 | No healthy targets registered | Check target group health; verify targets are in correct subnets |\n| WebSocket disconnects | Proxy not configured for upgrades | Add `proxy_set_header Upgrade` and `Connection \"upgrade\"` |\n\n## Related Skills\n\n- reverse-proxy (`reverse-proxy`) - Reverse proxy configuration patterns\n- dns-management (`dns-management`) - DNS records pointing to load balancers\n- cdn-setup (`cdn-setup`) - CDN in front of load balanced origins\n- service-mesh (`service-mesh`) - Service-level load balancing in Kubernetes\n\n## Limitations\n\n- Infrastructure commands can disrupt services: confirm target host\u002Fscope and have backups\u002Fsnapshots before mutating state.\n- Docs-only import: upstream scripts and templates not bundled.\n\n",{"name":5,"risk":24,"source":43,"license":14,"category":44,"metadata":45,"date_added":48,"description":7,"source_repo":49,"source_type":30,"compatibility":50,"license_source":51},"https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills","devops",{"author":46,"version":47},"devops-skills","1.0","2026-09-20","BagelHole\u002FDevOps-Security-Agent-Skills","Requires the relevant OS\u002Fplatform tooling and privileged access where noted. Docs-only; helper scripts and templates not bundled.","https:\u002F\u002Fgithub.com\u002FBagelHole\u002FDevOps-Security-Agent-Skills\u002Fblob\u002Fmain\u002FLICENSE","f3312ba749561b6159f477dbfc9313c875d40a56",".agents\u002Fskills_archive\u002Fload-balancing","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612","2026-10-25 23:50:58",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill load-balancing",{"tool":63,"command":64},"bunx","bunx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill load-balancing",{"tool":66,"command":67},"pnpm","pnpm dlx skills add duc-duy-1612\u002FOnline-Delivery-Systems-Web --skill load-balancing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fload-balancing\u002FSKILL.md",true,[],[72,94,118,142,170,194],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":83,"publishedAt":38},"01M6Q0FA5FZ410Z33Z3TFQ4DBA","zero-trust","Implement zero-trust network architecture. Configure identity-based access, micro-segmentation, and continuous verification. Use when implementing modern security architectures.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzero-trust\u002FSKILL.md",[78],{"categoryNo":79,"categoryName":80,"taxonomyType":81,"taxonomyTypeDesc":82},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[84,85,86,87,88,89,74,90,36,35,34,32,30,29,91,24,92,23,22,93],"ZeRO","trust","zero trust","architecture","assessment","verification","segmentation","active","scope","implementing",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":38},"01M6Q0F1YZJW3KX5FBKEVZ8CV4","zcode-delegate","Delegate coding tasks to the Z.AI ZCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fzcode-delegate\u002FSKILL.md",[],[101,102,103,104,105,106,107,108,109,110,111,112,113,32,114,30,115,116,24,117],"delegate","zcode","zcode delegate","review","cli","orchestration","tasks","run","Bash","model","node","read","orchestrator","files","desktop app","app","agent-orchestration",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6Q0ETK41VGNMYEXW0T00AJN","youtube-transcript","Fetch YouTube transcripts through DeepAPI or local fallback tooling and save clean text output.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript\u002FSKILL.md",[],[125,126,127,128,129,130,131,37,132,133,134,135,136,30,29,137,138,139,140,141],"transcript","youtube transcript","youtube","safe","github","codex","research","https","text","fetch","tooling","clean","local","output","deepapi","youtube transcripts","blob",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":159,"publishedAt":38},"01M6Q0EPPH2PVMDW40017F8WX0","youtube-transcript-skills","Fetch YouTube video transcripts, search videos\u002Fchannels, browse channels, and extract playlists via the getyoutubetranscript.com API - free tier, no card required.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-transcript-skills\u002FSKILL.md",[148,151,154],{"categoryNo":149,"categoryName":150,"taxonomyType":81,"taxonomyTypeDesc":82},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":152,"categoryName":153,"taxonomyType":81,"taxonomyTypeDesc":82},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":155,"categoryName":156,"taxonomyType":157,"taxonomyTypeDesc":158},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[125,126,127,160,128,161,129,130,37,162,163,164,165,134,166,30,29,167,168,169],"youtube transcript skills","gemini","search","api","Video","browse","api-integration","free","card","channels",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":180,"publishedAt":38},"01M6Q0EAB96PX83W5PTE8A0R8D","youtube-notetaker","Turn YouTube talks into local study notes with slides, transcripts, editable annotations, and a markdown-backed viewer.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-notetaker\u002FSKILL.md",[176,179],{"categoryNo":177,"categoryName":178,"taxonomyType":81,"taxonomyTypeDesc":82},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":152,"categoryName":153,"taxonomyType":81,"taxonomyTypeDesc":82},[127,181,182,105,128,183,184,185,186,37,164,187,188,189,190,29,191,137,192,193],"youtube notetaker","notetaker","workflow","official","notes","code","markdown","slides","annotations","README","study","dair-academy","viewer",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":201,"publishedAt":38},"01M6Q0E55F0GW5MX48V8HXS8B5","youtube-full","Fetch YouTube transcripts, search videos, browse channels, and extract playlists via TranscriptAPI — no yt-dlp, no Google API key, works from any cloud server.","https:\u002F\u002Fgithub.com\u002Fduc-duy-1612\u002FOnline-Delivery-Systems-Web\u002Fblob\u002Fmain\u002F.agents\u002Fskills_archive\u002Fyoutube-full\u002FSKILL.md",[200],{"categoryNo":149,"categoryName":150,"taxonomyType":81,"taxonomyTypeDesc":82},[202,127,203,204,128,161,162,205,206,163,164,165,134,207,166,30,29,167,208,140],"youtube full","full","google","server","dlp","credits","automatic"]