without creating ssl certificate, django app and nginx using docker works fine
While trying to install lets encrypt certificate with the following command, I run into this issue. what is being missed?
docker-compose -f docker-compose-deploy.yml run --rm certbot certonly --manual --webroot-path /var/www/certbot/ -d example.com
Following problem keeps persisting
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: example.com
Type: connection
Detail: Fetching http://example.com/.well-known/acme-challenge/bkNM7S88bVGypFpUHsnNdasfaRgA3GKqTGX2jciYD4H_I: Connection refused
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.
Docker-compose file looks like this:
proxy:
build:
context: ./proxy
restart: always
depends_on:
- app
ports:
- 80:8000
- 443:443
volumes:
- static-data:/vol/static
- ./certbot/conf/:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
certbot:
image: certbot/certbot:latest
volumes:
- ./certbot/conf/:/etc/letsencrypt
- ./certbot/www/:/var/www/certbot
NGINX conf file :
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
server_tokens off;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://example.com$request_uri;
}
location /static {
alias /vol/static;
}
}
server {
listen 443 ssl;
server_name example.com;
location / {
proxy_pass http://example.com;
}
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
uwsgi_pass ${APP_HOST}:${APP_PORT};
include /etc/nginx/uwsgi_params;
client_max_body_size 10M;
}
}