Config SSL (HTTPS) for swarm manager. Not TLS

Hi all,

I’m a newbie in docker community.
I’ve docker host (swarm cluster) configuration TLS -> It run stable on VM environment is ok.
When I need to publish to outside.
Have a domain redirect to above docker host

If I called service used HTTP -> ok
But HTTPS-> NOT FOUND.

I worked around then I found 2 ways config SSL (HTTPS) as below:

  1. Using Nginx installed on swarm manager to reverse proxy and point to docker host
  2. Config SSL (HTTPS) on dockerfile before build image

All both ways are tested but responded still is not found.

//config nginx case 1st

server {
listen 80;
listen [::]:80;
server_name xyz;
rewrite ^(.*) https://$server_name$1 permanent;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name xyz;
ssl_certificate /home/ssl/certificate.crt;
ssl_certificate_key /home/ssl/private.key;
location / {
#Redirect to swarm cluster
proxy_pass http://localhost:8080;
try_files $uri $uri/ =404;
}
}

Help me, please. Thanks all!!!

Can you help me, please