Create /etc/nginx/conf.d/misskey.conf or /etc/nginx/sites-available/misskey.conf and copy the following example to the file. (The file name does not have to be "misskey".)
Edit as follows:
Replace example.tld with the domain you have prepared. ssl_certificate and ssl_certificate_key should be the path to the certificate obtained from Let's Encrypt.
If using a CDN such as Cloudflare, remove 4 lines from "If it's behind another reverse proxy or CDN, remove the following."
If you create /etc/nginx/sites-available/misskey.conf, create symlink as /etc/nginx/sites-enabled/misskey.conf. sudo ln -s /etc/nginx/sites-available/misskey.conf /etc/nginx/sites-enabled/misskey.conf
Run sudo nginx -t to verify that the configuration file will be loaded successfully.
Run sudo systemctl restart nginx to restart nginx.