Configuring load balancers

From jeremylongshore/claude-code-plugins-plus-skills · View interactive version

Configuring load balancers is an AI agent skill from the GitHub repository jeremylongshore/claude-code-plugins-plus-skills. Configure use when configuring load balancers including ALB, NLB, Nginx, and HAProxy. Trigger with phrases like "configure load balancer", "create ALB", "setup nginx load balancing", or "haproxy configuration". Generates production-ready configurations with health checks, SSL termination, sticky ses

How to use this skill

Skill file

Configuring Load Balancers

Overview

Configure load balancers across AWS (ALB, NLB), GCP (HTTP(S) LB, TCP/UDP LB), Nginx, and HAProxy. Generate production-ready configurations with health checks, SSL/TLS termination, path-based and host-based routing, sticky sessions, rate limiting, and traffic distribution rules for high-availability deployments.

Prerequisites

Instructions

  1. Select load balancer type based on requirements: ALB for HTTP/HTTPS with path routing, NLB for TCP/UDP with static IPs, Nginx for on-prem reverse proxy, HAProxy for high-performance TCP/HTTP
  2. Define the backend pool: list all backend server addresses, ports, and weights for weighted distribution
  3. Configure health checks with appropriate interval (10-30s), timeout (5s), healthy threshold (3), and unhealthy threshold (2)
  4. Set up SSL/TLS termination: configure certificates, redirect HTTP to HTTPS, set minimum TLS version to 1.2
  5. Define routing rules: path-based routing (/api -> API pool, /static -> CDN), host-based routing (api.example.com -> API)
  6. Enable session persistence (sticky sessions) using cookies or source IP affinity where needed for stateful applications
  7. Add connection draining to gracefully handle backend removal during deployments
  8. Configure logging and monitoring: access logs to S3/CloudWatch, request metrics, error rate dashboards
  9. Test the configuration: validate syntax (nginx -t, HAProxy config check), verify traffic distribution, and confirm failover behavior

Output

Error Handling

| Error | Cause | Solution |

|-------|-------|---------|

| 502 Bad Gateway | Backend server unreachable or not responding | Verify backend IPs, ports, and firewall rules; check backend service health |

| SSL certificate verify failed | Certificate expired, wrong chain, or key mismatch | Verify certificate validity and chain with openssl s_client; regenerate if needed |

| Target is unhealthy | Health check endpoint returning non-200 or timing out | Verify health check path returns 200; increase timeout if backend is slow to respond |

| nginx: configuration file test failed | Syntax error in Nginx configuration | Run nginx -t to identify the specific error line; fix syntax and test again |

| Session persistence not working | Cookie-based stickiness misconfigured or client not sending cookies | Verify cookie name matches; use IP-based affinity as fallback for non-browser clients |

Examples

Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.