Elk stack docker with traefik


I have elk stack in docker with tls from documentation Running the Elastic Stack on Docker | Getting Started [7.12] | Elastic

I try run this on server with traefik. I add traefik network for kibana container and add labels:

And I have 502 Bad Gateway on this adres. Stack wihout tls is working with this labels.
any ideas why is this happening?

I'm not familiar with Traefik and Docker, but I do use Traefik with Kubernetes. One thing you might want to try is making sure you set the scheme that Kibana uses, as I believe by default, even if you are using an https entrypoint, Traefik will still try to send the connection to an http backend.

Here is a Kubernetes example (it's not a 1-to-1 match, but should help)

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
  name: kibana-https-ingress
    - websecure
    - kind: Rule
      match: KIBANA_MATCH_RULE
        - kind: Service
          name: KIBANA_SERVICE_NAME
          port: 5601
          passHostHeader: true
          scheme: https #<----- Scheme set here to https (as Kibana is setup to uses https instead of http)
          serversTransport: kibana-server-transport
    secretName: kibana-cert
      name: kibana-tls-options
      namespace: KIBANA_NAMESPACE