I have a very basic round-robin reverse proxy setup for learning purposes.
upstream file_server_com {
server machine-01;
server machine-02;
}
server {
listen 80 default_server reuseport;
listen [::]:80 default_server ipv6only=on reuseport;
root /usr/share/nginx/html;
index index.html index.htm;
server_name localhost;
location / {
proxy_pass http://file_server_com;
}
}
I have a 1kb file on the each of the upstream servers. I run wget to download the file. I'm not seeing the requests ping-pong between machine 01 and 02. Overall, I do see about a 50/50 split between the two, but I would have thought I should see the requests alternate between the two machines.
Sometimes I'll see machine 01 get the request consecutively, sometimes I'll see machine 02 get consecutive requests, sometimes they alternate.
Is there something I'm not understanding about nginx's round-robin load balancer?