Answer the question
In order to leave comments, you need to log in
How to install ssl certificate on Ubuntu + docker?
I have an Ubuntu 18 server with docker installed on it. Containers are running in the docker, in which there are sites on nginx. There can be any number of such containers. Purchased domain type site.ru. Each site container is forwarded to an external port. Now they (container sites) look at the world through links.
http://site.ru:8001
http://site.ru:8002
http://site.ru:8003
etc. https://site.ru:8001
https://site.ru:8002
https://site.ru:8003
Answer the question
In order to leave comments, you need to log in
I figured everything out, created one nginx proxy container, mounted the nginx config and certificate there.
Thanks to the guys from reg.ru helped set up the certificate. (As it turned out, this is not difficult, but I forgot how)
In docker-compose, I created a network like nginx_net.
And then each new container, if I need to set it up on a new port, I configure it not to an external port, but to the nginx_net network. And I open the external port in the proxy container.
Thus , the certificate is forwarded to only one container , and the remaining containers see only the nginx_net docker local network and there is no need to configure each container for external ports, ssl certificates, domains, etc.
Have one container with three virtual sites? You can register a certificate once, see for example https://www.linode.com/docs/web-servers/nginx/enab...
Offtopic: it's hard for me to imagine a situation where :port is more convenient than subdomain or site.ru/ site2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question