'Browse the application hosted in Linux using domain name instead of IP

I deployed the .NET core web API in Linux using the below command.

sudo docker run -dt -e "ASPNETCORE_URLS=https://+;http://+" -e ASPNETCORE_Kestrel__Certificates__Default__Password="password" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/<certificate.pfx> -v "<certificate path>/:/https/" -p 8081:80 -p 8080:443 --name <name> <image name>

But I am unable to map the domain name of the certificate used here to browse my API. I am able to browse it using the system IP.

I want to browse my API using the domain name instead of the IP.



Sources

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

Source: Stack Overflow

Solution Source