Hi everyone! I tried to run the command but I keep getting an authentication error. I've spent the whole day trying to fix this but hav been unsuccessful so far . Here is all the info!
My domain is:
www.mynacode.com
I ran this command:
docker compose run --rm certbot -v certonly --webroot --webroot-path /var/www/certbot/ --dry-run -d mynacode.com -d www.mynacode.com
It produced this output:
Simulating a certificate request for mynacode.com and www.mynacode.com
Performing the following challenges:
http-01 challenge for mynacode.com
http-01 challenge for www.mynacode.com
Using the webroot path /var/www/certbot for all unmatched domains.
Waiting for verification...
Challenge failed for domain mynacode.com
Challenge failed for domain www.mynacode.com
http-01 challenge for mynacode.com
http-01 challenge for www.mynacode.com
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: mynacode.com
Type: unauthorized
Detail: 54.226.28.103: Invalid response from http://mynacode.com/.well-known/acme-challenge/Ug51ZHLBRwxVgd6LhncjvEVQt0Mr0ueWbkI4jua3lEU: "<!doctype html><html lang="en"><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="
Domain: www.mynacode.com
Type: unauthorized
Detail: 54.226.28.103: Invalid response from http://www.mynacode.com/.well-known/acme-challenge/oowA0z6RUPzGpBzstpPVZ00X3-yW9OnSH6_uowvdS_M: "<!doctype html><html lang="en"><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="
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.
My web server is (include version):
I'm using docker image nginx:latest
The operating system my web server runs on is (include version):
Ubuntu
My hosting provider, if applicable, is:
AWS Lightsail
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):
I'm using docker image certbot/certbot:latest
Here is my docker_compose.yml file
version: '3'
services:
backend:
build:
context: ./backend/src
command: gunicorn djreact.wsgi --bind 0.0.0.0:8000
ports:
- "8000:8000"
depends_on:
- pgdbpgdb:
image: postgres
environment:
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- pgdata:/var/lib/postgresql/datafrontend:
build:
context: ./frontend/gui
volumes:
- react_build:/frontend/buildnginx:
image: nginx:latest
ports:
- 80:8080
- 443:443
restart: always
volumes:
- ./nginx/nginx_setup.conf:/etc/nginx/conf.d/default.conf:ro
- react_build:/var/www/react
- ./certbot/www:/var/www/certbot/:ro
- ./certbot/conf/:/etc/nginx/ssl/:ro
depends_on:
- backend
- frontend
- certbotcertbot:
image: certbot/certbot:latest
volumes:
- ./certbot/www/:/var/www/certbot/:rw
volumes:
react_build:
pgdata:
Here is my nginx.conf file
upstream api {
server backend:8000;
}server {
listen 8080;
listen 443 ssl;server_name 54.226.28.103 mynacode.com www.mynacode.com;
location /.well-known/acme-challenge/ { root /var/www/certbot; }
location / {
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
root /var/www/react;
try_files $uri /index.html;
return 301 https://mynacode.com$request_uri;
}location /api/ {
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
proxy_pass http://api;
proxy_set_header Host $http_host;
}}