nginx - How to access Django App from NodeJS deployment in EC2 container -


i have django app machine learning server. used serve real-time predictions nodejs app. running application in amazon ec2 container , web-server in nginx. don't want expose django application outside world node.js server. have nodejs application running in ec2 container , accesses django application like

 request.post('http://localhost:8000/polls/distance', {         form: {             _id : json.stringify(req.user._id),             "arr": json.stringify(arr)         }     }, (err, body, response) => {         if (err)             throw err;         else {             console.log(response);             res.status(200).send(response);         }     }); 

my django app running locally @ address http://127.0.0.1:8000. works fine on local system when try run on ec2 instance doesn't work. have tried command 'python manage.py runserver 0:8000' , tried accessing via ipaddress:port notation , loads saying bad request. close port on ec2 instance once works nobody outside can access it. because if cannot work in browser not work in request module node.js that's understanding is. have referred lot of post this , still haven't got answer. great if django community people fellow newbie started.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -