There could be multiple reasons for this:
Incorrect Nginx Configuration: The nginx configuration file should have the correct port number defined, and it should match the port number specified in the inbound security rule in your EC2 instance. If the configuration file is incorrect, nginx will not be able to bind to the specified port number.
Firewall Restrictions: Make sure that the firewall on the EC2 instance is not blocking the incoming traffic to port 8080. Check the firewall rules and add an exception for port 8080 if necessary.
Port Conflict: It's possible that another service or process is using port 8080 and preventing nginx from binding to it. You can use the lsof command to check which process is using the port, and either stop the process or change its port number to resolve the conflict.
If none of these solutions works, try checking the error log of nginx to get more information on the issue and resolve it.