Here is an example, I have an Linux instance , say, private IP is 10.10.10.10, public IP is 18.104.22.168.
Inside the instance, I could successfully ping it's private IP(10.10.10.10) and localhost. However, I cannot access it's public IP(22.214.171.124).
The reason I need to use it's public IP instead of localhost is because it's the same IP configuration which I will be used for this server as well as for other servers.
I can imagine it's related with part which how public IP associate with private IP. Therefore, the inbound and outbound traffic is somehow lost. But I would really want to know more details.