Question
Configuring DNS for nginx and confirming load balancing.
Hi, I’m testing out nginx round-robin load balancing and am fairly new to this.
1)Can I configure DNS so that I can access the webserver via a domain name instead of IP?
2)How can I check if load balancing is working? I have 2 web servers and want to know which server gets the request when a client sends the request.
This is my nginx code(very basic)
upstream web_backend {
server 10.11.12.51;
server 10.11.12.52;
}
server {
listen 80;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://web_backend;
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×