Before moving to docker swarm or kubernetes, I try something simple to balancing application by using nginx load balancer. But how to know if our setup working or not? In nginx there is easy way to check that

  1. Open your nginx load balancer config, add this line at the top
log_format upstreamlog '$server_name to: $upstream_addr {$request} '
'upstream_response_time $upstream_response_time'
' request_time $request_time';

  1. Add access_log /var/log/nginx/your-server-access.log upstreamlog; at line server { … }

    Log File Location

    Log File Location


  2. Restart your nginx service & check your log using tail -f

    It’s work!

    It’s work!

Source: stackoverflow-how to test load balancing nginx