>_ IzzyLab

Hands-on task

This task is step 14 of the course “nginx basics”

HTTPS with a self-signed certificate

medium~20 min

Generate a self-signed TLS certificate for myapp.local (the CN must contain myapp.local) and configure nginx to serve HTTPS on port 443 with it.

What you'll practise:
  • openssl
  • tls
  • self-signed certificate
  • nginx ssl
  • https

Topic breakdown

A TLS certificate cryptographically binds a domain name to a key pair and confirms the server's identity. Self-signed means the server is its own certificate authority: the browser doesn't trust it, but the channel encryption is fully functional — enough for local and testing use. Generating the key and certificate is done with the openssl tool (the req subcommand), and nginx enables encryption via listen ... ssl and the directives that point to the certificate and private key paths.

What's checked

  1. HTTPS responds on port 443
  2. the certificate CN contains myapp.local

What it looks like