How do I set up multiple websites on one droplet and configure DNS correctly ?


I have a Ubuntu 14.04 droplet, running a nodejs and a nginx server. The nodejs server distribute a website on port 80, and the nginx serves a WordPress on 1337. I easily binded my domain name to the nodejs server, but am struggling to do the same for my wordpress installation … I can’t figure out how to bind my domain to a specific port (which apparently is impossible), and I can’t think of another way of binding two domains on two servers hosted on the same machine.

Help ? :)

Thank you in advance !


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I think what you want to do is have your Wordpress served from nginx on port 80 and set up your node to listen on 1337. Then set up forwarding as per this tutorial.

server {
    listen 80;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;


I’m in the same situation, but I don’t want to use for the blog. I would like to use

is it possible? (I have the nodejs app in

Thanks you very much @asb and @phocks, I finally figured it out ! Thanks to both of your tutorial, I managed to better understand nginx :)