Possible to use without containers, simple web proxy?

Is it possible to use Traefik as an HTTPS proxy for non-containerize-ed web servers?
I have two web servers (on the same computer as Traefik) that I want proxied via SNI. I need the subdomain to point to the related web server.

I don't see where this is possible from the (rather confusing) documentation.

1 Like

I am looking for the same information.

I am running Docker on Windows 10 and would like to route https://something.domain.com to http://192.168.1.123:81. From what I can tell, this is possible. I think you can have a router for https://something.docmain.com and a service for http://192.168.1.123:81 and map the router to the service. I just can't find a working example.

Specifically, I am looking for an example with a docker-compose.yml for the static configuration that references a traefik.yml for dynamic configuration. The docker-compose.yml file should contain the absolute minimum to access an insecure dashboard on localhost:8080 that references the traefik.yml file. The traefik.yml file should contain just the minimum configuration to route a host on a domain to an HTTP IP Address/Port hosted outside of Docker.

OP - is that what you're looking for, too?

1 Like

That is just about it, though I'm not using Docker.

Is a dynamic config file required us Traefik? I was wanting to use just the static file config.

Hello @Justin and @prichards14,

yes, you need a static and a dynamic configuration file.

Add the dynamic file provider to your config (see https://doc.traefik.io/traefik/providers/file/ ):

traefik.yaml (snippet):

# [...]
providers:
  file:
    filename: /path/to/config/dynamic.yaml
# [...]

Add HTTP Router and HTTP Service to your dynamic configuration:

dynamic.yaml (snippet):

# [...]
http:
  routers:
    my-router:
      rule: "Host(`something.example.invalid`)"       
      service: my-service

  services:
    my-service:
      loadBalancer:
        servers:      
        - url: "http://192.168.1.123:81/"
# [...]

You also want to add some extra stuff, like TLS encryption and security headers middleware.

Hope this helps,
Wolfgang

2 Likes

It was helpful. Thanks.

1 Like