To install Nginx on RHEL 6 or CentOS 6 using the yum command, you can follow these steps:
sudo rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
This will add the Nginx repository to your system and allow you to install Nginx packages using yum.
sudo yum install nginx
This will install the latest version of Nginx available in the repository.
sudo service nginx start sudo chkconfig nginx on
Open a web browser and navigate to http://localhost. You should see the default Nginx welcome page, indicating that Nginx is working correctly.