You’re probably better off following the AWS documentation for configuring HTTPS on Elastic Beanstalk: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-nodejs.html
Whilst you could potentially fix the above error by adding a server_name in your nginx config, the changes (and also your certificates) are going to be wiped out every time your app is re-deployed.
The correct way to do what you are trying to do is to use Elastic Beanstalk with an AWS load balancer and a free certificate from AWS ACM, deployed to the load balaner.
Certbot wasn’t built to be used in temporary, horizontally-scaled environments like Elastic Beanstalk.