How do I have multiple IP for my droplet?

Posted November 29, 2017 5.9k views
NginxUbuntu 16.04

Pardon my ignorance. I don’t know if the question I’m asking is right…

I used to use dreamhost VPS where you can have multiple folder for different website and you can assign different domain you’ve bought to those folder. I just get started with DigitalOcean and can now get my laravel to run with Nginx but it involve setting up virtual host and in virtual host we have server_name which I suspect is the DNS/IP of the website.

What about if I want to add another virtual host to another folder in /var/www/, how do I get another IP from?

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.

Submit an Answer
2 answers

If you follow this guide it will show you how to set up multiple domains on one server.

With a set up like this, you would have multiple domains pointing to one IP address as you would only have one IP address per server. The server itself will determine what files to serve based on the domain name.

by Justin Ellingwood
When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu 16.04 server.

The name of the server is the domain name[s] that would appear in the HTTP request in order for this virtual host to match. You do not need an additional IP to do this.