I have different projects some using flask code and some plain html/d3 files. I want to viz them on the web for any user to access the insights.
I came across this process of using pm2 and nginx as a good way to keep the server running forever and also have the ability to run multiple apps on the same ubuntu host ip.
I did everything as mentioned in the tutorial and while running pm2 to start a web server using http-server I see the following.
$ pm2 start $(which http-server) -p 8000
For nginx I did the following after installing nginx on ubuntu
sudo rm /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
sudo nano /etc/nginx/sites-enabled/default
Then I entered the following config in nginx/sites-enabled/default file
server {
location /sunburst {
root /home/web_apps/;
proxy_pass http://localhost:8000;
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;
}
}
I want to run this app on 8000. I also read I can add another location block with another port and app name for another app to run on same host ip.
After doing all this, I restart nginx
sudo /etc/init.d/nginx restart
It says restarted nginx in console and pm2 screenshot is shown as above.
But when I go to the host ip in browser and type:
10.4.145.182:8000
It doesn't show anything and says can't connect. When I just enter 10.4.154.184 I get default nginx message.
I am not sure where I am going wrong and how to get that running on browser. I am stuck in this for days and any help would be advisable.
Thanks