CloFix Load Balancer: Intelligent Traffic Distribution

Published on CloFix Blog | 12 min read

CloFix Load Balancer provides intelligent traffic distribution across multiple backend servers, ensuring your applications remain fast, reliable, and secure.

99.99%
Availability SLA
<1ms
Latency Overhead
5+
Load Balancing Algorithms
100K+
Concurrent Connections

🛡️ Backend Information Hiding

CloFix Load Balancer automatically hides your backend infrastructure information from clients, preventing attackers from discovering your internal architecture.

📋 Headers Automatically Removed

Server
X-Powered-By
X-AspNet-Version
X-AspNetMvc-Version
X-Runtime
X-Version
X-Generator
X-Backend
X-Backend-Server
X-Backend-Host
X-Backend-IP
X-Upstream
X-Upstream-Server
X-Origin
X-Origin-Server
X-Proxy-Host
X-Proxy-IP
Via
X-Cache
X-Cache-Hit
X-Cache-Miss
X-Proxy-Cache
X-Varnish
X-Debug
X-Debug-Token
X-Request-ID
X-Correlation-ID
X-Real-IP
X-Forwarded-For
X-Forwarded-Host
X-Forwarded-Proto

🔄 Response Body URL Rewriting

# Before
backend domain: clofix.com → frontend domain: demo.clofix.com
http://clofix.com/page → https://demo.clofix.com/page

# After (client sees)
https://demo.clofix.com/page

All backend URLs in HTML, JSON, and XML responses are automatically rewritten to show only your frontend domain.

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 TypeTrigger ConditionMessage FormatAction Required
🔴 DOWNBackend fails max_fails consecutive checksURL, Domain, Time, Failure reasonInvestigate backend server
🟢 UPBackend passes health check after being downURL, Domain, Time, Recovery statusVerify service is stable
⚠️ WARNINGBackend latency exceeds thresholdURL, Response time, Threshold valueMonitor 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

OptionDescriptionDefaultExample
weightLoad balancing weight (higher = more traffic)1weight=10
backupBackup server (used only when primaries fail)falsebackup=true
max_failsMax failures before marking unhealthy3max_fails=5
fail_timeoutTime to consider backend down after failures30sfail_timeout=60s
max_connsMax concurrent connectionsunlimitedmax_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;
}
AlgorithmDescriptionBest ForSticky Session Support
round_robinDistributes requests sequentially across serversEqual capacity, stateless apps✓ Yes
least_connSends to server with fewest active connectionsLong-lived connections, varying load✓ Yes
ip_hashSame client IP always goes to same backendSession persistence without cookies✓ Built-in
randomRandom distribution across serversSimple load balancing, testing✓ Yes
weightedBased on server weight configurationUnequal 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.

🚀 Deploy CloFix Load Balancer Today