Install Nginx on RHEL 9
Step 1 – Update and enable EPEL
dnf update -y
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
Step 2 – Install Nginx
dnf install -y nginx
Step 3 – Enable and start
systemctl enable --now nginx
Step 4 – Firewall
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
Step 5 – Verify
nginx -v
curl -I http://localhost
Config: /etc/nginx/nginx.conf, vhosts in /etc/nginx/conf.d/.