Question

static & dynamic nginx setup

  • Posted April 24, 2015
  • Nginx

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

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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 like

location /you_static_site/ {
  root /var/www/static_site_on_droplet;
}