Change root directory for a domain?

April 8, 2014 2.4k views
I have a development directory (/build) and a public directory (/public) how do I serve the public directory as the home? I don't want to have to do a re-direct or obviously serve the site on Any thoughts I can't find anything? P.S I am not using any stack, I don't think I need apache (even though I think it's installed already) or php. This is a node.js app and I think I may eventually run this on port 3000, and eventually need to figure out how to serve that on port 80 instead.
2 Answers
Hi Michael,

There are a number of ways that you can accomplish this. I'd suggest serving your site with Nginx. This article should set you on the right path:

If the node.js app is going to run on port 3000, your Nginx configuration could be as simple as:

server {
listen 80;


location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
by Christian Fei
This is our tutorial on hosting multiple Node.js apps on a single VPS with nginx, forever, and crontab.
Ah nice, I was just reading into that I came across this and I figured I probably need to be running on apache or nginx.

by Wouter ten Bosch
Here's how to install Laravel with Nginx on an Ubuntu 12.04 LTS VPS.
Have another answer? Share your knowledge.