How to Configure SSL for Nginx on Ubuntu 26.04

To configure SSL for Nginx on Ubuntu 26.04 with a self-signed certificate (lab/test) for example.com, follow these steps.

Step 1 : Update.

Step 2 : Install OpenSSL.

Step 3 : Generate a key and cert.

Step 4 : Create the SSL server block.

Step 5 : Enable the site.

Step 6 : Test and restart.

Step 7 : Open HTTPS and skip the browser warning (self-signed).

You have configured SSL for Nginx on Ubuntu 26.04.