5. Portainer +TLS

Para acceder a Portainer utilizando dominio +TLS no hace falta cambiar nada en compose.yaml, pero si en el archivo correspondiente de configuración en nginx.

~/docker/swag/nginx/proxy-confs/portainer.subfolder.conf
location /portainer {
    return 301 $scheme://$host:10000/portainer/;  # <-- editar
}

location ^~ /portainer/ {
    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app portainer;
    set $upstream_port 9443;  # <-- editar
    set $upstream_proto https;  # <-- editar
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    rewrite /portainer(.*) $1 break;
    proxy_hide_header X-Frame-Options; # Possibly not needed after Portainer 1.20.0
}

location ^~ /portainer/api {
    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app portainer;
    set $upstream_port 9443;  # <-- editar
    set $upstream_proto https;  # <-- editar
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    rewrite /portainer(.*) $1 break;
    proxy_hide_header X-Frame-Options; # Possibly not needed after Portainer 1.20.0
}