You first need to install the epel-release package and then install nginx package:
yum install epel-release -y
yum install nginx -y
Then you need to add nginx service to the firewall at both https and http ports, publicly.
sudo firewall-cmd --permanent --zone=public --add-service=https --add-service=http
sudo firewall-cmd --reload