First you have to open port on Oracle Cloud interface, after that you need to update iptables of your server to accept connection
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT
sudo netfilter-persistent save
Create an Ingress Rule for your VCN
- Open the navigation menu and click Networking, and then click Virtual Cloud Networks.
- Select the VCN you created with your compute instance.
- With your new VCN displayed, click <your-subnet-name> subnet link.The public subnet information is displayed with the Security Lists at the bottom of the page. A link to the Default Security List for your VCN is displayed.
- Click the Default Security List link.The default Ingress Rules for your VCN are displayed.
- Click Add Ingress Rules.An Add Ingress Rules dialog is displayed.
- Fill in the ingress rule with the following information.Fill in the ingress rule as follows:
- Stateless: Checked
- Source Type: CIDR
- Source CIDR: 0.0.0.0/0
- IP Protocol: TCP
- Source port range: (leave-blank)
- Destination Port Range: 80
- Description: Allow HTTP connections
- Click Add Ingress Rules.Now HTTP connections are allowed.
You have successfully created an ingress rule that makes your instance available from the internet.
Related stackoverflow answer
https://stackoverflow.com/a/64053781/643641