I have been trying to run multiple Node.js apps on one server using NGINX and it kind of work. Everything works as it should except for public folders inside each app.
Right now I have 2 apps running and both have their own css inside public folder, first app work great, but second always takes css from first app's public folder.
server {
listen 80;
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;
}
location /weatherapp {
proxy_pass http://localhost:3001;
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;
}
}
Right now this is my NGINX setup.
Can anyone help, I have been trying to figure it out for almost 2 days, but nothing works.