GTHell
By:
GTHell

How do I have multiple IP for my droplet?

November 29, 2017 83 views
Nginx Ubuntu 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/example.com, how do I get another IP from?

2 Answers

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

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

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.

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...

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.

Have another answer? Share your knowledge.