static & dynamic nginx setup

Posted April 24, 2015 3.6k 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

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.

Submit an Answer
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;