Please don't use init-letsencrypt.sh. Your certificate is saved in the location specified in the output in the screenshot. You should change the nginx configuration to reflect that exact location: notice that the current certificate has -0001 in the directory name while nginx is looking for a directory without that.
when i generate certificates for other domains it successfully create with this init-letesencrypt.sh but when i try to execute init file for this domain demo.erisp.co it give me the error which i share in the screenshot
#2: Start over [even if you have to begin at the beginning]
You already have certbot installed, and we know that can get certs - I'd use that directly.
first of all our organization using certbot in nginx docker-compose file and we have configure many domains through this script but we face the issue only with this domain we have done the correct dns configuration in godaddy but still we face the issue
here is my nginx docker compose file
version: '3'
services:
nginx:
image: nginx:1.13
container_name: nginx
logging:
options:
max-size: "10m"
max-file: "3"
ports:
- "80:80"
- "443:443"
# - "8069:8069"
# logging:
# options:
# max-size: "10m"
# max-file: "3"
restart: always
networks:
- net-erisp
# volumes to be mounted from the container
# Mount paths as volumes, optionally specifying a path on the host machine
# (HOST:CONTAINER), or an access mode (HOST:CONTAINER:ro).
volumes:
# mount the nginx config file in the container
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./conf.d:/etc/nginx/conf.d:ro
- ./html:/usr/share/nginx/html:ro
- ./log:/var/log/nginx
# mount the ssl certificates
- ./ssl:/etc/nginx/ssl:ro
- ./sites-enabled:/etc/nginx/sites-enabled:ro
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: always
networks:
- net-erisp
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
net-erisp:
name: net-erisp
external: true
#networks:
# default:
# name: ddev_default
# external: true
user nginx;
worker_processes 16;
worker_rlimit_nofile 200000;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# optmized to serve many clients with each thread, essential for linux
use epoll;
# accept as many connections as possible, may flood worker connections if set too low
multi_accept on;
}
http {
# Default server
server {
# return 502;
# include /etc/nginx/conf.d/default502;
return 404;
}
# Other servers
include /etc/nginx/sites-enabled/*;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# to boost IO on HDD we can disable access logs
#access_log off;
access_log /var/log/nginx/access.log main;
sendfile on;
# send headers in one peace, its better then sending them one by one
tcp_nopush on;
# don't buffer data sent, good for small data bursts in real time
tcp_nodelay on;
open_file_cache max=100000 inactive=15m;
open_file_cache_valid 2m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
keepalive_timeout 65;
client_header_timeout 3000;
client_body_timeout 3000;
client_max_body_size 20000;
#keepalive_requests 100000;
gzip on;
gzip_min_length 5000;
gzip_types text/html application/x-javascript text/css application/javascript text/javascript text/plain text/xml application/json application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype application/x-font-ttf application/xml font/eot font/opentype font/otf image/svg+xml image/vnd.microsoft.icon;
gzip_disable "MSIE [1-6]\.";
include /etc/nginx/conf.d/*.conf;
}