I have a .net core http server that works on local windows and linux machines. When I try to deploy it on AWS, I can't let it listen on its public ip address. Doing so gives me an exception:
Unhandled Exception: System.Net.HttpListenerException: Cannot assign requested address
If I try to listen on its private ip, the programme runs without exception, I cannot send any http request to its public ip address.
I confirm that the security group setting and ufw status show that in both cases, port 80 is allowed. What could be the reason for the problem?