iis – Website works remotely but not on the server itself when called by domain

I am using Windows Server 2019 and in IIS 10 I have created a website and I have bound it to both: “localhost” and “mydomain.com” on port 80.

mydomain.com works correctly from any client but on the server only when I call “localhost” it works otherwise I get the following error (when called by domain):

enter image description here