502 Bad gateway connect: connection refused

Hi all!

I'm very new in traefik, but seems so interesting.

I'm on ECS and now have traefik 2 working. I can see the dashboard and see the docker services.

But when I try to accesss to docker url it give me a 502 Bad gateway

I can see into debug log file this:

time="2021-04-08T20:30:26Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.31.36.244:81: connect: connection refused"

My Docker labels:

  "dockerLabels": {
        "traefik.http.routers.termaire.rule": "Host(`termaire.gmao.cloud`)",
        "traefik.enable": "true",
        "traefik.http.services.termaire.loadbalancer.server.scheme": "https",
        "traefik.http.services.termaire.loadbalancer.server.port": "81"
      },

I have expose port 81 into docker , and I have setup Nginx into port 81 too

Curl on port 81 failed

curl --verbose https://172.31.36.244:81
* Rebuilt URL to: https://172.31.36.244:81/
*   Trying 172.31.36.244...
* TCP_NODELAY set
* connect to 172.31.36.244 port 81 failed: Connection refused
* Failed to connect to 172.31.36.244 port 81: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 172.31.36.244 port 81: Connection refused

But "works" (not really, seems a problem with ssl) on 80!

curl --verbose https://172.31.36.244:80
* Rebuilt URL to: https://172.31.36.244:80/
*   Trying 172.31.36.244...
* TCP_NODELAY set
* Connected to 172.31.36.244 (172.31.36.244) port 80 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

I want to have some docker instances, one for each customer, and each one into different port (81, 82, 83, ...)