My domain is:
http://nottoboard.com
I ran this command:
docker compose -f docker-compose.web.yaml run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ --dry-run -d nottoboard.com
It produced this output:
Account registered.
Simulating a certificate request for nottoboard.com
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: nottoboard.com
Type: unauthorized
Detail: 46.101.66.242: Invalid response from http://nottoboard.com/.well-known/acme-challenge/To73fUfETvgUiwHPEcFrpNz57pV9bTldYYgfrk5AQ0s: 404
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
make: *** [certbot-dry-run] Error 1
My web server is (include version): Nginx
This is my Nginx server Dockerfile -
I have tried to run this locally and ssh into the remote Digital Ocean droplet. So I am copying the certbot dirs over both ways, here in the Dockerfile after running the certbot cmd locally for debugging and then for the remote server that's where it uses the volumes - I will remove this when i get it working and just run the certbot cmd with Terraform.
FROM --platform=linux/amd64 nginx:1.7
COPY default.conf /etc/nginx/conf.d/default.conf
COPY certbot/www /var/www/certbot
COPY certbot/conf /etc/nginx/ssl
RUN chmod 755 /var/www/certbot
RUN chmod 755 /etc/nginx/ssl
The operating system my web server runs on is (include version):
Ubuntu 20
My hosting provider, if applicable, is:
Digital Ocean
I can login to a root shell on my machine (yes or no, or I don't know): YES
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): NO
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): certbot 2.11.0
Nginx conf
client_max_body_size 20M;
upstream django {
server main_app:8001;
}
server {
listen 80;
listen [::]:80; # Add this line for IPv6
server_name nottoboard.com www.nottoboard.com;
location /.well-known/acme-challenge/ {
allow all;
alias /var/www/cerbot/;
}
location / {
proxy_pass http://django;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /static/ {
alias /static/;
}
location /media/ {
alias /media/;
}
}
docker-compose
nginx:
container_name: nginx-proxy
image: "bandnoticeboard/nottoboard:nginx_web-v0.0.21"
volumes:
- ./certbot/www/:/var/www/certbot
- ./certbot/conf/:/etc/letsencrypt
- static:/static
- type: bind
source: /mnt/notto_media_1
target: /media
restart: always
ports:
- "80:80"
- "443:443"
depends_on:
- main_app
certbot:
image: "certbot/certbot:latest"
volumes:
- ./certbot/www/:/var/www/certbot
I ran the dry run certbot cmd but the issue seems to be that it doesn't create any To73fUfETvgUiwHPEcFrpNz57pV9bTldYYgfrk5AQ0s
temporary challenge files. It does create 2 directories, www
& conf
but the www
directory is always empty.
Then also my nginx doesn't want to serve any static files in the /.well-known/acme-challenge/ path. I tried creating a test index.html file, ran chmod 755 index.html
and when i navigate to http://nottoboard.com/.well-known/acme-challenge/index.html i still get the 404...
The domain is registered with Godaddy, website is hosted on Digital Ocean. I have a static IP that then points at the Droplet's IP as I tear down the droplet with Terraform to push up updates.