Subdomain with other droplet (Ubuntu+ Nginx)

Posted October 11, 2014 3.1k views

I suggest me what are I should to learn
I need to create 1 droplet for domain
Then I need to have which is use other droplet (different ip) like this on ubuntu 14.04 and nginx server.


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
3 answers

You shouldn’t have to use two separate Droplets. You would just use multiple server blocks in your configuration.

server {
  access_log logs/mydomain.access.log main; 

  root /var/www/;

server {
  access_log  logs/server1.mydomain.access.log main;

  root /var/www/;

I need to use 1 droplet for 1 service.
I have 2 service to serve.

Create two Ubuntu 14.04 droplets, follow How To Install Linux, nginx, MySQL, PHP (LEMP) stack on Ubuntu 14.04 | DigitalOcean on both, and then set up your DNS records accordingly: How To Set Up a Host Name with DigitalOcean | DigitalOcean.

Your DNS records should look like this:

@          A first droplet's IP address
server1 A second droplet's IP address
by Justin Ellingwood
A LEMP stack (Linux, Nginx, MySQL, and PHP) is a powerful set of software that can be configured to serve dynamic sites and web apps from your server. In this guide, we will discuss how to install a LEMP stack on an Ubuntu 14.04 server.