502 error on adding MONGO_URL environment variable

I am working on hosting my meteor app and mongodb on different servers. adding MONGO_URL din’t work. To make things easier, I have removed bind-ip and port from mongo server. After changing environment variable MONGO_URL, I can connect meteor app on local machine to remote mongodb server, but not application hosted on server to the same server. while the application on server works well if I set MONGO_URL to localhost, just changing the MONGO_URL is giving 502 error.