大网数据广告活动
服务器运维问答

Error installing LetsEncrypt SSL: (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain

· 52CE 我爱测

I am trying to install LetsEncrypt on my server (which I have root SSH access to), for staging.dnslaude.com - which is a publicly accessible domain, pointing to 213.212.81.89 . The server is running ubuntu 16.04 , and an nginx we…

问题原文

原帖链接 · Tom Lord · CC BY-SA 3.0

I am trying to install LetsEncrypt on my server (which I have root SSH access to), for staging.dnslaude.com - which is a publicly accessible domain, pointing to 213.212.81.89.

The server is running ubuntu 16.04, and an nginx web-server. Below is the nginx config:

server {
  listen 80;
  server_name staging.dnslaude.com;

  root /path/to/webroot;

  location ^~ /.well-known/acme-challenge/ {
    try_files $uri $uri/ =404;
  }
  rewrite ^(.*) https://$host$1 permanent;
}

server {
  listen 443;
  ssl on;
  ssl_certificate /path/to/self/signed/certificate.crt;
  ssl_certificate_key /path/to/key.key;

  server_name staging.dnslaude.com;

  root /path/to/webroot;

  # ....

  location ^~ /.well-known/acme-challenge/ {
    try_files $uri $uri/ =404;
  }
}

You can see that the nginx config appears to work, as I have manually placed a file in the acme-challenge folder here.

However, when I run the command:

letsencrypt certonly --webroot -w /path/to/webroot -d staging.dnslaude.com

It returns the following error:

Failed authorization procedure. staging.dnslaude.com (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to staging.dnslaude.com

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

Domain: staging.dnslaude.com Type: connection Detail: Could not connect to staging.dnslaude.com

To fix these errors, please make sure that your domain name was
entered correctly and the DNS A 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.

I followed the basic setup guide outlined here, and have tried all sorts of configuration variations, such as those suggested here. However, I cannot get past the above error - and cannot see anything in a log file to indicate the cause.

Any suggestions?

已采纳解答

原帖链接 · BE77Y · CC BY-SA 3.0

Your nginx config looks correct.

On a hunch, I ran nmap against your domain (since you included it in your question); it would appear that you are currently filtering port 80, so there is no way for LetsEncrypt to connect externally and verify.

You'll need to make sure that port 80 is made externally accessible on the local firewall of the server in question (as well as any ACLs which might be in place on a vhost provider or similar).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。