Multi Application revers proxy routing over Port 443

Hi,

We are currently in search of a reverse proxy solution for our application. Unfortunately, the implementation with nginx is not feasible, which led me to discover Traefik.

Here's the scenario:

We have an agent that communicates natively using MQTT and REST. Both of these communication channels need to be handled over Port 443. Additionally, there is a need for location directives to distinguish between three routes.

The agents must communicate through a reverse proxy (in this case, potentially Traefik), which will forward the requests to the backend zones.

Example scenario:

Agent A needs to handle MQTT Topic "A_Agent" as both a producer and a consumer.

MQTT (native) at http://proxy-server1:443 => Routed to mqttbackend1.net:1833

Agent A also needs to access three REST endpoints:

  1. https://proxy-server1:443/api => Routed to http://backend1.net
  2. https://proxy-server1:443/ => Routed to http://backend2.net
  3. https://proxy-server1:443/Repository => Routed to http://reposerver1/Repository

Is it possible to implement this with Traefik?

The Traefik router is doing the routing, a request needs to be matched via a rule, various matchers are available (doc).

If your MQTT is using a different hostname in TLS (HostSNI), then you should be able to use the same server/IP/port with a dedicated TCP router (doc)

Alright, I've successfully configured MQTT over TCP and set up HTTP routes. It appears that, without specific rules, all connections default to the TCP router.

However, I've encountered a challenge with certificate requests going through the proxy based on a JWT token. I'm going to explore and experiment a bit to find a solution. I'm considering looking into ALPN (Application-Layer Protocol Negotiation) for potential alternatives. Thanks for your support

Maybe check simple Traefik example.