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 sessions, and traffic distribution rules.
This skill is limited to using the following tools:
assets/README.mdassets/haproxy_template.confassets/nginx_template.confreferences/README.mdscripts/README.mdscripts/generate_config.pyBefore using this skill, ensure:
Nginx Configuration:
# {baseDir}/nginx/load-balancer.conf
upstream backend_servers {
least_conn;
server 10.0.1.10:8080 weight=3;
server 10.0.1.11:8080 weight=2;
server 10.0.1.12:8080 backup;
}
server {
listen 80;
server_name app.example.com;
location / {
proxy_pass http://backend_servers;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 5s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
location /health {
access_log off;
return 200 "healthy\n";
}
}
AWS ALB (Terraform):
# {baseDir}/terraform/alb.tf
resource "aws_lb" "app_alb" {
name = "app-load-balancer"
internal = false
load_balancer_type = "application"
security_groups = [aws_security_group.alb_sg.id]
subnets = aws_subnet.public[*].id
}
resource "aws_lb_target_group" "app_tg" {
name = "app-target-group"
port = 80
protocol = "HTTP"
vpc_id = aws_vpc.main.id
health_check {
path = "/health"
interval = 30
timeout = 5
healthy_threshold = 2
unhealthy_threshold = 2
}
}
resource "aws_lb_listener" "app_listener" {
load_balancer_arn = aws_lb.app_alb.arn
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-TLS-1-2-2017-01"
certificate_arn = aws_acm_certificate.cert.arn
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.app_tg.arn
}
}
Backend Server Unreachable
SSL Certificate Error
Health Check Failures
Configuration Syntax Error
nginx -t to validate syntax and fix errorsSession Persistence Not Working