Docker nginx error: openssl: command not found
I found the solution.
In my nginx Dockerfile, I had to use
FROM nginx:1.12-alpineRUN apk update \ && apk add openssl...
Then the openssl command worked properly.
At first, you can try edit your start.sh file at line openssl
to /usr/bin/openssl
. Did /usr/bin/openssl
exists?
Second, your nginx server will not start until /etc/letsencrypt/live/api.domain.com/fullchain.pem
and /etc/letsencrypt/live/api.domain.com/privkey.pem
file exists.
So delete or comment all the server block that handling 443 port, keep server block that handling 80 port. Your api.conf will become this:
server { listen 80; server_name api.domain.com; location ^~ /.well-known/acme-challenge/ { default_type "text/plain"; root /var/www/letsencrypt; } location = /.well-known/acme-challenge/ { return 404; } return 301 https://$host$request_uri;}
Then start your nginx server and retry install Let's Encrypt certificate.