How to Configure SSL for Nginx on Ubuntu 24.04

To configure SSL for Nginx on Ubuntu 24.04, follow the steps below.

Step 1 : Make sure your system is up-to-date by running:

Step 2 : Install OpenSSL if not already installed

Step 3 : Generate SSL certificates using OpenSSL. Replace example.devtutorial.io with your domain:

Step 4 : Create a new server block configuration file for your domain:

And add the following configuration:

Step 5 : Enable the Configuration

Step 6 : Test Nginx Configuration

Step 7 : Restart Nginx

Step 8 : Visit your Domain

Go to your domain (e.g., https://example.devtutorial.io) in a web browser and ignore any security warnings.

Congratulations! You have successfully configured SSL for Nginx on Ubuntu 24.04.