Open longshaof opened 6 years ago
You have redirect on acme chalenge URL. Fix this.
$ curl -vs http://domain.com/.well-known/acme-challenge/wRZRgNHEE-Ue6Oa5ZPr9CY8Y9lN9mHUsAWczIyZAi_g
* Trying 18.221.195.49...
* Connected to domain.com (18.221.195.49) port 80 (#0)
> GET /.well-known/acme-challenge/wRZRgNHEE-Ue6Oa5ZPr9CY8Y9lN9mHUsAWczIyZAi_g HTTP/1.1
> Host: domain.com
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Wed, 04 Jul 2018 15:42:48 GMT
< Content-Type: text/html
< Content-Length: 178
< Connection: keep-alive
< Location: https://domain.com/.well-known/acme-challenge/wRZRgNHEE-Ue6Oa5ZPr9CY8Y9lN9mHUsAWczIyZAi_g
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
@orgoj i have tried this command,but still get some error curl -vs http://domain.com/.well-known/acme-challenge/wRZRgNHEE-Ue6Oa5ZPr9CY8Y9lN9mHUsAWczIyZAi_g
You still have redirect. Exist file /var/www/html/domain.com/.well-known/acme-challenge/wRZRgNHEE-Ue6Oa5ZPr9CY8Y9lN9mHUsAWczIyZAi_g ? You must modifi nginx domain.com virtual config, for not to redirect /.well-known/acme-challenge/ to CMS.
Same problem. Take a long time to figure out.
My solution: Edite NGINX config to disable 301 redirections (http to https), restart NGINX, then run the command to get the cert.
ubuntu 18.04 +nginx 域名用 domain.com 替代了