Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

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!
Nice write up. I suggest though instead of:
rewrite ^/(.*)$ http://www.demo.com/$1 permanent;
you use:
return 301 $scheme://www.demo.com$request_uri;
A return is quicker than a rewrite, and $scheme is protocol-independent.
Thank you for your review.
Yes, you are right, I did not consider a return (which seems to be regarded as being faster)
Does this assume that Wordpress is already installed? I’m having trouble understanding the order in which to follow the tutorials. I think I should follow:
Correct?
Remember to configure your DNS to fit your subdomains or with a wildcard (*)
Thanks for the excellent write-up! I did everything as you described and it went smoothly but now im wondering if i need an unique ip for each simple wordpress installation. I want to have 5 separated wordpress blogs, each with its own database and wordpress installation files but i dont know if for each server_name i should use a different ip and then use domain mapping. Thats the only thing im not fully understanding. Any help appreciated!
@stk.walshy: server_name should be the blog’s domain name. You don’t need one ip per blog :]
@stk.walshy
You can have multiple domains pointing to an unique IP (your server’s IP) NGINX can serve different “folders (root)” depending on the “domain (server_name)” :
For example,
let’s say that we have domain1.com domain2.com domain3.com domain4.com & domain5.com
Suppose that you want to host them in one of your digitalocean servers
You will need to create 5 Databases
Extract WordPress (Five times since you have 5 blogs) & add the required permissions:
a.) /home/demouser/sitedir1;
b.) /home/demouser/sitedir2;
c.) /home/demouser/sitedir3;
d.) /home/demouser/sitedir4;
e.) /home/demouser/sitedir5;
Remember to edit wp-config.php
Configure NGINX so that it knows which folders to serve depending on the domain. You will need to create 5 server blocks and edit server_name & root: server { … server_name domain1.com; root /home/demouser/sitedir1; … } server { … server_name domain2.com; root /home/demouser/sitedir2; … }
Remember to configure your DNS If you have any questions, please feel free to ask.
I must have transposed something and am getting a ‘this page is not redirecting properly’. Any clue where I can start troubleshooting?
I managed to find an error message but cannot see in any of the modified files where I’ve snafu’d: 2014/01/14 12:55:19 [warn] 3456#0: conflicting server name “162.243.236.35” on 0.0.0.0:80, ignored
Any help is appreciated.