Installing NGINX on CentOS 8

“NGINX is open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more.” -nginx.com.

Install the nginx package with the command:

sudo dnf install nginx

When prompted, confirm the installation by entering “y”.

After the installation has completed, start the server with the command:

sudo systemctl start nginx

To make sure that the NGINX server starts up when your CentOS 8 server reboots, run the command:

sudo systemctl enable nginx

If you use the firewalld package, you will need to whitelist the HTTP port(80) to allow connections. Run the command:

sudo firewall-cmd --permanent --add-service=http

You would then need to reload firewalld to accept the changes. Run the command:

sudo firewall-cmd --reload

NGINX should then be running as expected. To test that the installation is successful, visit your server’s IP in your web browser. You should see the NGINX welcome page.

You can create your NGINX configuration files at the directory: /etc/nginx/conf.d

By default, NGINX will serve content from /usr/share/nginx/html/.