server { listen 80; listen [::]:80; # chantge server_name while generating cert server_name ; #access_log /var/log/nginx/host.access.log main; # this is required for cert generation. # change server_name as well with cname of required cert location /.well-known/acme-challenge/ { root /var/www/certbot; } }