letsencrypt,nginx,aws和nodejs无法设置

时间:2018-03-01 14:43:00

标签: node.js amazon-web-services nginx encryption

我在aws EC2实例上使用nginx设置letsencrypt但是当我执行下面的命令时

sudo certbot --nginx -d dnestaging2.com -d www.dnestaging2.com

我得到以下输出

  Saving debug log to /var/log/letsencrypt/letsencrypt.log
  Plugins selected: Authenticator nginx, Installer nginx
  Enter email address (used for urgent renewal and security notices) (Enter 'c' to
  cancel): email@email.com
  Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org

  -------------------------------------------------------------------------------
  Please read the Terms of Service at
  https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
  agree in order to register with the ACME server at
  https://acme-v01.api.letsencrypt.org/directory
  -------------------------------------------------------------------------------
  (A)gree/(C)ancel: A

  -------------------------------------------------------------------------------
  Would you be willing to share your email address with the Electronic Frontier
  Foundation, a founding partner of the Let's Encrypt project and the non-profit
  organization that develops Certbot? We'd like to send you email about EFF and
  our work to encrypt the web, protect its users and defend digital rights.
  -------------------------------------------------------------------------------
  (Y)es/(N)o: N
  Obtaining a new certificate
  Performing the following challenges:
  http-01 challenge for dnestaging2.com
  http-01 challenge for www.dnestaging2.com
  Using default address 80 for authentication.
  Waiting for verification...
  Cleaning up challenges
  Failed authorization procedure. dnestaging2.com (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: DNS problem: NXDOMAIN looking up A for dnestaging2.com, www.dnestaging2.com (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: DNS problem: NXDOMAIN looking up A for www.dnestaging2.com

  IMPORTANT NOTES:
   - The following errors were reported by the server:

     Domain: dnestaging2.com
     Type:   connection
     Detail: DNS problem: NXDOMAIN looking up A for dnestaging2.com

     Domain: www.dnestaging2.com
     Type:   connection
     Detail: DNS problem: NXDOMAIN looking up A for www.dnestaging2.com

     To fix these errors, please make sure that your domain name was
     entered correctly and the DNS A/AAAA record(s) for that domain
     contain(s) the right IP address. Additionally, please check that
     your computer has a publicly routable IP address and that no
     firewalls are preventing the server from communicating with the
     client. If you're using the webroot plugin, you should also verify
     that you are serving files from the webroot path you provided.
   - Your account credentials have been saved in your Certbot
     configuration directory at /etc/letsencrypt. You should make a
     secure backup of this folder now. This configuration directory will
     also contain certificates and private keys obtained by Certbot so
     making regular backups of this folder is ideal.

我不确定我在哪里制造错误以及如何使这项工作成功。它问我上面的问题,我回答他们,但是当它获得证书时,它会抛出错误。

任何解决方案都表示赞赏。

更新

BTW我在上面的输出中没有注册任何域名。我将它们添加到了53号公路,因为我正在使用它们。

1 个答案:

答案 0 :(得分:0)

根据以下错误,必须注册域名,以便DNS可以找到它。

  

详细信息:DNS问题:NXDOMAIN在dnestaging2.com上查找A

根据Registering Domain Names Using Amazon Route 53上的文档,域名必须在AWS Route 53上注册或从其他注册商转移。使用注册域名。