New to Claude Skills? Learn how to install them →

Cjeremylongshore on GitHub

Configuring Load Balancers

Free

Streamline load balancer configurations for production environments.

Get this skill

Free · Opens the source repo

What Configuring Load Balancers does

The Configuring Load Balancers skill is designed for developers and DevOps engineers who need to efficiently set up and manage load balancers across various platforms, including AWS, GCP, Nginx, and HAProxy. This skill automates the generation of production-ready configurations, which include essential features such as health checks, SSL termination, sticky sessions, and traffic distribution rules. By using this skill, users can ensure high availability and performance for their applications with minimal manual effort.

To use this skill, you need to have your backend servers identified and the type of load balancer determined, whether it be L4 or L7. The skill guides you through the configuration process step-by-step, from selecting the appropriate load balancer type to defining routing rules and health checks. It also includes options for SSL/TLS termination, ensuring secure communication for your applications. The output is comprehensive, providing configuration files for Nginx and HAProxy, as well as Terraform scripts for AWS and GCP, enabling seamless integration into your infrastructure.

This skill is particularly useful in scenarios where rapid deployment and scaling of applications are required, as it simplifies the configuration process and reduces the likelihood of errors. It is suitable for both cloud-based and on-premise environments, making it versatile for various deployment strategies. Whether you are setting up a new service or maintaining an existing one, this skill can help streamline your load balancing needs.

When to use it

Use this skill when you need to quickly set up or modify load balancer configurations for production environments.

When not to use it

This skill may not be suitable for highly customized load balancing scenarios that require manual configuration or specific vendor features not covered by the templates.

What you can build with it

Setup AWS ALB with Routing

Quickly configure an AWS Application Load Balancer with path-based routing to multiple target groups.

Generate Nginx Configurations

Create an Nginx reverse proxy configuration with upstream servers and sticky sessions for stateful applications.

Configure HAProxy for Databases

Set up a HAProxy configuration for load balancing TCP traffic across multiple database replicas with health checks.

How to install Configuring Load Balancers

View source

1. Install with the skills CLI

npx skills add jeremylongshore/claude-code-plugins-plus-skills/configuring-load-balancers --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by jeremylongshore

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

  • Backend servers identified with IPs, DNS names, and ports
  • Load balancer type determined: L4 (NLB, HAProxy TCP) or L7 (ALB, Nginx, HAProxy HTTP)
  • SSL/TLS certificates available (ACM, Let's Encrypt, or self-signed) if using HTTPS
  • Health check endpoints defined on backend services (e.g., /health returning 200)
  • Cloud provider CLI installed for managed load balancers (aws, gcloud)

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

  • Nginx configuration files (nginx.conf, site configs) with upstream blocks and server directives
  • HAProxy configuration (haproxy.cfg) with frontend/backend sections
  • Terraform HCL for AWS ALB/NLB with target groups, listeners, and rules
  • GCP load balancer Terraform with backend services, URL maps, and health checks
  • SSL certificate configuration and renewal automation

Error Handling

ErrorCauseSolution
502 Bad GatewayBackend server unreachable or not respondingVerify backend IPs, ports, and firewall rules; check backend service health
SSL certificate verify failedCertificate expired, wrong chain, or key mismatchVerify certificate validity and chain with openssl s_client; regenerate if needed
Target is unhealthyHealth check endpoint returning non-200 or timing outVerify health check path returns 200; increase timeout if backend is slow to respond
nginx: configuration file test failedSyntax error in Nginx configurationRun nginx -t to identify the specific error line; fix syntax and test again
Session persistence not workingCookie-based stickiness misconfigured or client not sending cookiesVerify cookie name matches; use IP-based affinity as fallback for non-browser clients

Examples

  • "Configure an AWS ALB with HTTPS listener, path-based routing to two target groups (/api and /web), and health checks on /health."
  • "Generate an Nginx reverse proxy config with upstream servers, sticky sessions via cookie, and rate limiting at 100 req/s per IP."
  • "Create a HAProxy configuration for TCP load balancing across 4 database read replicas with health checks and connection draining."

Resources

Frequently asked questions about Configuring Load Balancers

Similar skills