Tcp 将端口3306上所有的(非TLS)请求转发到 database 这个服务


## 动态配置
tcp:
  routers:
    to-database:
      entryPoints:
        - "mysql"
      # 捕获所有请求(仅适用于非tls路由器的规则,请参考下文。)
      rule: "HostSNI(`*`)"
      service: database

tcp:
  services:
    my-service:
      loadBalancer:
        servers:
        - address: "<private-ip-server-1>:<private-port-server-1>"
        - address: "<private-ip-server-2>:<private-port-server-2>"

service参数说明

https://doc.traefik.io/traefik/routing/services/



http配置

http:
  services:
    my-service:
      loadBalancer:
        servers:
        - url: "http://<private-ip-server-1>:<private-port-server-1>/"
        - url: "http://<private-ip-server-2>:<private-port-server-2>/"