I typed the following in Vim
server_name sample.com;
Reloaded Nginx and typed the following command
sudo systemctl reload nginx
sudo certbot --nginx -d sample.com
The following error occurred
Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot