How to Configure SSL for Nginx on Ubuntu 24.10

To configure SSL for Nginx on Ubuntu 24.10, follow these simple steps:

Step 1 : Run the following commands to ensure your system is up-to-date:

Step 2 : If OpenSSL is not already installed, you can install it using:

Step 3 : Create a self-signed SSL certificate for your domain:

Fill in the required details when prompted.

Step 4 : Create a configuration file for your domain (e.g., example.devtutorial.io):

Add the following content:

Save and close the file.

Step 5 : Create a symbolic link to enable the configuration:

Step 6 : Check for syntax errors in the Nginx configuration:

Step 7 : Apply the changes by restarting Nginx:

Step 8 : Visit your domain (e.g., https://example.devtutorial.io) in a browser.

If you see a security warning, bypass it since it is a self-signed certificate.

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