By Ashok Ra
Hi All,
I referred this tutorial -> [https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04] and created node js (app.js) and it works with Nginx reverse proxy @ api.iotboxapp.com/app1 & api.iotboxapp.com/app2 but when i use express app in node js , Nginx is not working , but locally its working please help me i have attached screen shots for reference here [https://drive.google.com/open?id=0B0um3JuXEgglcE9mcE83MXlrZGM]
http.createServer(function (req, res) { res.writeHead(200, {‘Content-Type’: ‘text/plain’}); res.end(‘Hello World\n’); }).listen(8080, ‘localhost’); console.log(‘Server running at http://localhost:8080/’);
app.get(‘/’,function(req,res){
res.send('Hello World3!');
});
app.listen(8090); console.log(‘Running on port 8090…’);
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Issue resolved by using same api path in nginx default configuration
app.get(‘/app3’,function(req,res){
res.send(‘Hello World3!’);
});
location /app3 { //… …// }
thanks all
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.