'How to solve challenge/9OR59XYu5ritOArRWv2nZzIAV2OkpWkjtpKk8hEhxfY: 404

I have been getting this error for a while now

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:

  Domain: eventvans-testing.seventhave.cloud

  Type:   unauthorized

  Detail: 34.196.184.249: Invalid response from http://eventvans-testing.seventhave.cloud/.well-known/acme-challenge/9OR59XYu5ritOArRWv2nZzIAV2OkpWkjtpKk8hEhxfY: 404

The setup is as follows.

  • spin up ec2 instance on was
  • associate an elastic IP to the DNS name of the instance
  • Create docker-compose file with nginx and certbot as below
 nginx:
   image: nginx
   ports: 
     - 80:80
     - 443:443
   volumes:
     - ./nginx/conf/:/etc/nginx/conf:ro
     - ./certbot/conf:/etc/letsencrypt:ro
     - ./certbot/www:/var/www/certbot:ro
   restart: always
   depends_on:
     - certbot

 certbot:
   image: certbot/certbot:latest
   env_file:
     - .env
   volumes:
     - ./certbot/conf:/etc/letsencrypt:rw
     - ./certbot/www:/var/www/certbot:rw
   # restart: always
   command: certonly --webroot -w /var/www/certbot --force-renewal --email ${CERT_EMAIL} -d ${DOMAIN} --agree-tos --server ${LETSENCRYPT_SERVER}

The certbot service always return the error above.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source