Deploy 2 apps, 2 domains on 1 VPS. Is that possible?

October 21, 2014 1.6k views

Is it possible to deploy 2 or more diffrent apps, get 2 or more domains on one VPS instance?

1 Answer

It's very possible, I do it myself. Point both/all your domains at the IP address of the VPS and then install Nginx as a reverse proxy. Make sure it's bound to port 80 and your other apps are bound to different ports. Then in the nginx site config (/etc/nginx/sites-enabled/default), included server{} blogs for each domain, listening to port 80 and forwarding to the port of that particular app.

Have another answer? Share your knowledge.