firewall-cmd --zone=public --add-service=http
Also, we like to add an HTTPS service to the firewall, just like below:
firewall-cmd --zone=public --add-service=https
Then we need to apply above setting in the firewall, use below snippet:
firewall-cmd --reload
Finally, confirm that port or service was opened successfully:
firewall-cmd --list-all