I’m hosting a Flask app on an Oracle Cloud Always Free Ubuntu VM. The app runs on port 5000, and I’ve added an iptables rule to redirect port 80 to 5000:
bash
CopyEdit
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 5000
Firewall Configuration:
- NSG and Subnet Security List both allow TCP ingress from
**0.0.0.0/0**
to port 80
- UFW also allows port 80
- The VM has a public IP, and the route table includes a default route via Internet Gateway
Problem:
Accessing the public IP on port 80 times out (took too long to respond
), even though:
- Flask works locally on
127.0.0.1:5000
- iptables redirect is in place
- No other services are using port 80
What might be blocking the traffic?