'Nodejs axios cant resolve host file?

I have a server which hosts multiple application. One of the application is accessible only by vpn only which has domain somedev.com.

I have another application which needs to access that application.

I use axios to access the domain https://somedev.com

Since both application are in same server i added host file to resolve somedev.com. But node cant find the somedev.com

On local server i can connect the vpn and it works successfully. But on prod where both application lives on the same server can't resolve the ip written in host file.

Any workaround around this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source