static & dynamic nginx setup

April 24, 2015 848 views

I have a static and dynamic site that I want to setup to run on the same droplet. I have the static site working with nginx currently and believe that the dynamic one must use a reverse proxy (but not sure). How do I get both of them on there together so that when I type in the respective url it pulls up the correct site?

I am using angular and the MEAN stack for the dynamic site and have it installed on Ubunto

1 Answer

Use location section on you nginx conf, default path if you use ubuntu /etc/nginx/nginx.conf, add new location section for server configuration, and add to root

location /you_static_site/ {
  root /var/www/static_site_on_droplet;
Have another answer? Share your knowledge.