Skip to content

Instantly share code, notes, and snippets.

@thanhtantran
Created December 15, 2024 15:03
Show Gist options
  • Save thanhtantran/e6620632a762fc7f26240b439aec98d2 to your computer and use it in GitHub Desktop.
Save thanhtantran/e6620632a762fc7f26240b439aec98d2 to your computer and use it in GitHub Desktop.
Nginx load_balancer exampls
http {
upstream backend_servers {
server 192.168.100.101;
server 192.168.100.102;
server 192.168.100.103;
}
server {
listen 80;
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;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment