I host a handful of websites for friends and projects of mine. None of them is particularly resource-intensive, but they’re not all the same thing. A few are static sites served by Nginx, one is a Javascript Wiki, one is Mastodon, some are bespoke servers I’ve written in Swift.
I’d love to containerize these on a single slightly bigger Droplet than having a handful of small Droplets. But in order to allow multiple services to respond on port 443, I need to assign multiple public IP addresses to the one Droplet. Can this be done?
Alternatively, I’m thinking of reverse-proxying everything through a single Nginx service, and maybe even letting Nginx handle all the SSL. It can then route requests based on hostname (at least, I think this is a viable approach). It’s bit more complex than I’d like in terms of configuration, in that I have to coordinate the container config with a change to the Nginx config, so I think I still prefer having multiple IP addresses.
BUT: I don’t know if it’s even possible, and I don’t know if that will cost so much that it would wipe out any savings I get from consolidating Droplets in the first place.
I’d consider going IPv6-only, too, if someone could reassure me I wouldn’t become too inaccessible to the rest of the world.
Thoughts? TIA!
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!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya @jetforme,
Droplets come with a single IP address however you can also attach 1 extra reserved IP address as described here:
As for allowing multiple services to respond on ports 443 and 80, you can use Nginx as a reverse proxy, that is the standard way and I’ve used it all my life without any issues. So rather than spending money on different Droplets and reserved IP addresses, just use Nginx as a reverse proxy and proxy requests on port 80 and 443 to the internal ports your apps are using.
Hey!
Each Droplet comes with a single public IP address, you can also attach 1 extra reserved IP address as described here:
However there is no need to have multiple public IP addresses in order to host multiple websites. Your alternative idea of using Nginx as a reverse proxy is a widely adopted solution for hosting multiple services on a single server (or Droplet). Nginx is very efficient at handling SSL termination and can route traffic based on the hostname to different backend services, regardless of whether those services are containerized or run directly on the host:
Going IPv6-only could significantly limit accessibility for your services. Despite the growing adoption of IPv6, a significant portion of the internet (including many residential ISPs and older corporate networks) does not fully support IPv6. This could make your services inaccessible to a portion of your audience. It’s generally recommended to support both IPv4 and IPv6 where possible.
Let me know if you have any questions!
Best,
Bobby