Restrict EC2 Traffice from Tunnel Only

I removed the Port 3000 from Security group of Ec2 and now it stops working, Bad gateway 502 error now.