Mongo DB works with raw TCP instead of HTTP so we need create stream
with Nginx.
Add the below code above http
block in nginx config file (eg: /etc/nginx/nginx.conf
for Ubuntu)
stream {
server {
listen 9999;
proxy_connect_timeout 1s;
proxy_timeout 3s;