How to Set Up Nginx Server Blocks on Fedora 39

To set up multiple websites on a Fedora 39 server using Nginx, you can create server blocks (virtual hosts) to host different domains on the same server. This guide will walk you through the process.

Step 1 : Update and Install Nginx

Step 2 : Create Directory and Index File

Add some content to the index.html file.

Step 3 : Set Permissions

Step 4 : Create Nginx Server Block Configuration

Add the following configuration:

Step 5 : Test Nginx Configuration

Step 6 : Restart Nginx

Step 7 : Access the Web Page

Open a web browser and navigate to http://example.devtutorial.io to test the website.

Congratulations! You have successfully set up Nginx server blocks on Fedora 39, allowing you to host multiple websites on a single server.