Http-01 Challenge failed and Connection refused

I just bought a new server, and want to follow this for After putting in related files, I got this error:

root@iZj6ce932fiflob4gudnajZ:~/nginx-certbot# ./ 
Existing data found for Continue and replace existing certificate? (y/N) y
### Creating dummy certificate for ...
Generating a RSA private key
writing new private key to '/etc/letsencrypt/live/'
failed to resize tty, using default size

### Starting nginx ...
Recreating nginx-certbot_nginx_1 ... done

### Deleting dummy certificate for ...
failed to resize tty, using default size

### Requesting Let's Encrypt certificate for ...
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for
http-01 challenge for
Using the webroot path /var/www/certbot for all unmatched domains.
Waiting for verification...
Challenge failed for domain
Challenge failed for domain
http-01 challenge for
http-01 challenge for
Cleaning up challenges
Some challenges have failed.

 - The following errors were reported by the server:

   Type:   connection
   Detail: Fetching
   Connection refused

   Type:   connection
   Detail: Fetching
   Connection refused

   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.

### Reloading nginx ...
cannot exec in a stopped state: unknown

Here is the record I added to

It’s a very new domain, I don’t understand what’s blocking.

Thank you

you are using the HTTP Challenge instead of the DNS Challege

Specify the DNS Challenge and you should be able to set it up

Here is the reference

@ahaw021 Why would you suggest changing from a relative easy challenge to a relative hard challenge? Personally, I don’t see any reason to use the dns-01 challenge at this stage.

@chengtie Do you actually use docker on your server? Or is it just for this script?

It is a new server, and I want to implement this website with docker+nginx+letsencrypt.

OK. Well, I’m not a big fan of the script you’ve posted, but I personally don’t have any docker experience what so ever.

Firstly, please set the staging variable in the script to 1 for the time being while you’re still testing it out.

Secondly, from the last line, it looks like your nginx docker container didn’t really start properly. Perhaps you could debug that first separately from the script: does the nginx docker container even work?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.