I purchased a Comodo PositiveSSL Certificate. I followed their guideline here https://comodosslstore.com/blog/installing-comodo-positivessl-certificate-on-nginx.html, however I use a container for nginx (it is not installed on the server). So, I copied the key created on the server and added it to my project and I mount it in nginx container:
nginx:
image: nginx:latest
container_name: nginx
volumes:
- ./:/var/www
- .docker/nginx.production.conf:/etc/nginx/nginx.conf
- .docker/ssl/ssl-bundle.crt:/etc/ssl/ssl-bundle.crt
- .docker/ssl/mykey.key:/etc/ssl/mykey.key;`
``
(this key is copied from the one created with the openssl command and added manually in my project)
In nginx.conf I have this:
`server {
listen 443 default_server ssl http2;
listen [::]:443 default_server ssl http2 ipv6only=on;
server_name site.com;
ssl_certificate /etc/ssl/ssl-bundle.crt;
ssl_certificate_key /etc/ssl/mykey.key;
ssl_prefer_server_ciphers on;`
Now when I run docker compose up, Nginx does not start and get this error :
`cannot load certificate key "/etc/ssl/mykey.key": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/ssl/mykey.key, r) error:10000080:BIO routines::no such file)`
New contributor
Gabriel Popa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.