Created
December 15, 2024 15:03
-
-
Save thanhtantran/e6620632a762fc7f26240b439aec98d2 to your computer and use it in GitHub Desktop.
Nginx load_balancer exampls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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