I want to run nginx to redirect requests to mongodb and a webservice both. I tried to use both server and stream directive but I was not able to get it right.
What should be the configuration file which I can use so that when I contact nginx server on 27017 port, I can access mongodb and when I access it on another webserver port, I should be redirected to the webservice running on tomcat.