How to share proxy connection for my droplets on DigitalOcean

June 30, 2016 427 views
Docker DigitalOcean Firewall Networking Configuration Management

I'm using CoreOS 1010.5.0 (stable) on one DigitalOcean droplet. I have an http proxy connection setup, so that when I connect to the "outside" world, the external IP shown is not the one I have (as external IP from DigitalOcean). So the proxy works, as it should.

What I'd like to do now, is to create one (or more) droplets, and be able to share my external proxy connection (from the 1st droplet) to my new droplets, using the private networking feature from DigitalOcean. Any suggestions on how to achieve this?

The problem: My proxy supplier only supports 1 "access IP", which means, I can use this proxy only from this first droplet I created. That's why I need to find some way to "share" this proxy connection to my new droplets.

My guess is, I would need to create some iptables rules and activate NAT. But then, on the 1st droplet, I need to setup a program that would "listen" to incoming connections from the other droplets, and redirect (force) them through the proxy. Maybe something like "TinyProxy" might help?
Or maybe HAproxy can do this?

Note: I'm using docker, so I'm pretty open to any suggestions!

1 Answer

If you only need to proxy http/https content then it might be easier to install a proxy server of your own on your first droplet. If it is set up already to proxy it's own web requests through your outside proxy service you can then set your other droplets to use your first droplet as their proxy server.

I found this Docker container that might fit the bill:


Have another answer? Share your knowledge.