Well, at this moment thanks to this tutorial I managed to configure Nginx correctly and now when I go to the subdomain of my website, everything works perfectly.
What the tutorial does not mention is how I can add a second domain in the /etc/nginx/sites-enabled/mydomain file since at the end of the tutorial the document already has an SSL certificate that points to a specific IP address and domain.
I have read that it is as simple as "copy and paste below the “server” block but in that specific example there are two server blocks, and if I try to create another file using the same content of that one but changing the IP and subdomain, I get an error when trying to restart Nginx saying there can’t be two files pointing to ::[80]:
I am trying to have a separate second site.
https://stackoverflow.com/questions/68196179/how-to-create-reverse-proxy-for-multiple-websites-in-nginx
Ok, basically create a second file which points to the directory of your second site. Just configure it for http and not HTTPS.
Then run certbot. If you have certbot nginx support installed, then it will ask you for which vhost you want to generate a certificate and it will automatically reconfigure the vhost file with the proper SSL config. It will even ask you if you want to automatically redirect from http to HTTPS.