How to Install Nginx on CentOS Stream 10

To install Nginx on CentOS Stream 10, follow the steps below:

Step 1 : Run the following command to update your system:

Step 2 : Install Nginx using the command:

Step 3 : Check the installed version of Nginx:

Step 4 : Enable and start the Nginx service:

Step 5 : Ensure Nginx is running by checking its status:

Step 6 : Allow HTTP and HTTPS traffic through the firewall:

Step 7 : Reload the firewall to apply changes:

Step 8 : Create a new configuration file for your domain:

Add your configuration inside this file, then save and close it.

Step 9 : Set up the root directory and create an index file:

Step 10 : If SELinux is enabled, set the appropriate context for your files:

Step 11 : Test your Nginx configuration for syntax errors:

Step 12 : Restart the Nginx service to apply changes:

Step 13 : Open your web browser and navigate to http://example.com to verify that your site is working.

Congratulations! You have successfully installed and configured Nginx on CentOS Stream 10.