To allow traffic on HTTP and HTTPS port, configuration is needed at 2 different places for an instance running Ubuntu.

1) In the running instance, go to Virtual cloud network and open specific ports

2) In Ubuntu, UFW is disabled be default, so configuration is not possible using UFW. Rather than using UFW, a more direct manipulation of the iptables configuration is necessary. The easiest way to do so is modifying /etc/iptables/rules.v4. The easiest way is to copy the line allowing SSH access and modify the newly copied line to accept traffic for port 80:

sudo nano /etc/iptables/rules.v4

Then add a line with the desired port like 80 or 443, you can add the line below the one which allows port 22.

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

Once the rule is added it can be enabled using the following command

sudo iptables-restore < /etc/iptables/rules.v4

Last updated