The issue was with the mapping of the domain in Server. When trying to open the domain from external network, it serves the website correctly. But when I tried to open on the browser on the same server it wasn't serving the request.
I added the domain name entry to the windows hosts file and resolved it to 127.0.0.1, then it started to work fine.
Thank you everyone for your efforts in helping me fixing the issue. Without your inputs I might not be able to fix this. The credit is all yours, but as there was no answer I created an answer for helping other who faces same issue.