CloFix Load Balancer: Intelligent Traffic Distribution
CloFix Load Balancer provides intelligent traffic distribution across multiple backend servers, ensuring your applications remain fast, reliable, and secure.
🛡️ Backend Information Hiding
CloFix Load Balancer automatically hides your backend infrastructure information from clients, preventing attackers from discovering your internal architecture.
| Header Type | Original (Backend) | After CloFix LB |
|---|---|---|
| Server | nginx/1.18.0 | CloFix-WAF |
| X-Powered-By | PHP/7.4 | Removed |
| X-Backend-Server | 10.0.0.25:8080 | Removed |
| X-Upstream | api.clofix.com:8443 | Removed |
| Location (redirect) | http://clofix.com/page | https://demo.clofix.com/page |
📢 Real-time Notifications
Stay informed about your backend infrastructure with instant notifications. CloFix Load Balancer automatically sends alerts when backends go down or recover.
🔴 Backend Down Alert
🔴 Backend DOWN URL: https://clofix.com:443 Domain: demo.clofix.com Time: 2026-03-26 10:30:45 Status: Unhealthy after 3 consecutive failures
🟢 Backend Recovered Alert
🟢 Backend RECOVERED URL: https://clofix.com:443 Domain: demo.clofix.com Time: 2026-03-26 10:32:15 Status: Health check passed, back in rotation
Configuration Example
Enable Notifications in your config:
alerts {
enabled on;
webhook_url "YOUR_WEBHOOK_URL";
}
💡 Tip: You can configure multiple alert channels including Slack, Email, Webhook, and Telegram.
| Alert Type | Trigger Condition | Message Format | Action Required |
|---|---|---|---|
| 🔴 DOWN | Backend fails max_fails consecutive checks | URL, Domain, Time, Failure reason | Investigate backend server |
| 🟢 UP | Backend passes health check after being down | URL, Domain, Time, Recovery status | Verify service is stable |
| ⚠️ WARNING | Backend latency exceeds threshold | URL, Response time, Threshold value | Monitor performance |
Backend Configuration
# Single Backend
backend https://clofix.com:443;
backend http://localhost:8080;
# Multiple Backends with Load Balancing
backends https://clofix.com weight=10 backup=false max_fails=3 fail_timeout=30s,
https://api.clofix.com:8443 weight=5 backup=false max_fails=3 fail_timeout=30s,
http://backup.clofix.com:8080 weight=1 backup=true max_fails=2 fail_timeout=60s;
Backend Options Reference
| Option | Description | Default | Example |
|---|---|---|---|
weight | Load balancing weight (higher = more traffic) | 1 | weight=10 |
backup | Backup server (used only when primaries fail) | false | backup=true |
max_fails | Max failures before marking unhealthy | 3 | max_fails=5 |
fail_timeout | Time to consider backend down after failures | 30s | fail_timeout=60s |
max_conns | Max concurrent connections | unlimited | max_conns=100 |
Load Balancing Algorithms
load_balancer {
algorithm round_robin; # round_robin | least_conn | ip_hash | random | weighted
sticky_session on;
sticky_session_cookie clofix_backend;
max_retries 3;
retry_timeout 5s;
}
| Algorithm | Description | Best For | Sticky Session Support |
|---|---|---|---|
| round_robin | Distributes requests sequentially across servers | Equal capacity, stateless apps | ✓ Yes |
| least_conn | Sends to server with fewest active connections | Long-lived connections, varying load | ✓ Yes |
| ip_hash | Same client IP always goes to same backend | Session persistence without cookies | ✓ Built-in |
| random | Random distribution across servers | Simple load balancing, testing | ✓ Yes |
| weighted | Based on server weight configuration | Unequal server capacities | ✓ Yes |
Health Checks & Monitoring
load_balancer {
health_check on;
health_check_path /health;
health_check_interval 10s;
health_check_timeout 3s;
health_check_expect 200;
}
Complete Configuration Example
domain demo.clofix.com {
https on;
redirect_http_to_https on;
backends https://clofix.com:443 weight=10 max_fails=3 fail_timeout=30s,
https://api.clofix.com:8443 weight=5 max_fails=3 fail_timeout=30s,
http://backup.clofix.com:8080 weight=1 backup=true;
load_balancer {
algorithm round_robin;
sticky_session on;
max_retries 3;
retry_timeout 5s;
health_check on;
health_check_path /health;
health_check_interval 10s;
health_check_timeout 3s;
health_check_expect 200;
}
ssl {
ssl_certificate /etc/ssl/certs/demo.clofix.com.crt;
ssl_certificate_key /etc/ssl/private/demo.clofix.com.key;
ssl_protocols TLSv1.2 TLSv1.3;
}
}
Key Features Summary
Load Balancing Algorithms
- Round Robin
- Least Connections
- IP Hash
- Weighted
- Random
Health Monitoring
- Active health probes
- Passive failure detection
- Automatic recovery
- Real-time alerts
Security Hardening
- Backend information hiding
- Header sanitization
- Client IP preservation
- TLS/SSL termination
Performance
- Connection pooling
- HTTP/2 support
- Zero-copy forwarding
- Gzip compression
Conclusion
CloFix Load Balancer provides a robust, secure, and high-performance solution for distributing traffic across your backend infrastructure. With intelligent algorithms, comprehensive health checking, and advanced security features like backend information hiding, it ensures your applications remain available and performant under any load.