I setup a load balancer with 1-click and attached 3 droplets to it. I want to know when a client made a request to the load balancer, which droplet it is connected to. I cannot find it when ssh into the droplet because the tcp connections only show the connection is from 127.0.0.1:[port].
Is there any way I can find out which droplet and which port the client is related?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
What you could do is to enable PROXY Protocol for the Load balancer.
The PROXY protocol is a way to send client connection information (like origin IP addresses and port numbers) to the final backend server rather than discarding it at the load balancer.
This information can be helpful for use cases like analyzing traffic logs or changing application functionality based on geographical IP.
You can do that by following the steps here:
https://www.digitalocean.com/docs/networking/load-balancers/#proxy-protocol
And then configure your Nginx or Apache services to accept PROXY protocol headers as described here:
https://www.digitalocean.com/docs/networking/load-balancers/resources/#proxy-protocol
Hope that this helps. Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.