Nginx Load Balancing
Distribute traffic for high availability and performance.
Configuration
upstream backend {
least_conn;
server 192.168.1.10:8000;
server 192.168.1.11:8000;
server 192.168.1.12:8000;
}
server {
listen 80;
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Algorithms
- round-robin - Default
- least_conn - Least connections
- ip_hash - Client IP based
Discussion 0
No comments yet. Be the first to start the discussion!
Leave a Comment