HugoDos
HugoDos

Reputation: 329

Traefik Connection Refused

I have setup up Traefik using the basic documentation on traefik github. All the services are located and mapped using the .docker.localhost to which I have created a dns entry in my private dns.

## traefik.yml

# Docker configuration backend
providers:
  docker:
    defaultRule: "Host(`{{ trimPrefix `/` .Name }}.docker.localhost`)"

# API and dashboard configuration
api:
  insecure: true

I can curl blackhole.docker.localhost and I get the desired results from within the container network and outside from mapping traefik port 80:80. Once I try to connect via a web browser to the same url I get connection refused.

Note: These services will be internal to my network only and will never be exposed to a real domain name.

Is there anything im just missing? or is traefik never intended to be used as this?

Edit: Forgot to mention I have turned on access logging. To which all curl requests are logged but the request from browser never make it through.

Upvotes: 1

Views: 5447

Answers (1)

HugoDos
HugoDos

Reputation: 329

SYN comment answered it. Since documentation uses *.localhost it allows curl from the device. Do not use *.localhost for anything cross devices as the browser rejects connections but curl doesn't.

tldr: dont use docker.localhost use docker.local (or anything)

Upvotes: 2

Related Questions