Using Both http and tcp in traefik routing

Hey all,

I have not been using Traefik for long and I love its simplicity when it comes to adding SSL and TLS to my local homelab service web apps. It is great. My current issue is that I am trying to set this up so that the ssh traffic will route through to port 22 for SSH and the web traffic (Ports 80 and 443) will route their respectively. How can I manage this in my config.yml.

Thank you. Have a great day!

Hey @ArcticStag

You can just create the new entry point that listens on a specific port, e.g. 22, and then create a TCP router. All incoming request that matches the router should be forwarded to your SSH server.

Here are a few examples on that forum:

Please refer also to the official documentation:

I hope that helps.

Thank you, Jakub

1 Like

Thanks, This is great.

Currently I have this setup to route my HTTP traffic like so

http:
 #region routers 
  routers:
    proxmox:
      entryPoints:
        - "https"
      rule: "Host(`proxmox.home.arcticstagmedia.com`)"
      middlewares:
        - default-headers
      tls: {}
      service: proxmox

Then following this up with

#region services
  services:
    proxmox:
      loadBalancer:
        servers:
          - url: "https://10.0.0.20:8006"
        passHostHeader: true

Would I need to remove this and change the whole config to be a tcp config or can I mix and match routing?

hi @ArcticStag

You can extend the existing configuration by adding a new entry point for TCP and create the routing for the SSH server. The new configuration should works correctly together with HTTP / HTTPS.

Thank you, Jakub

1 Like

I will try this out and see how I get on, Thank you!

:slightly_smiling_face:

I am keeping fingers crossed :wink: Let us know what are the results! :slight_smile: