Hello,
I'm new to docker and traefik. I'm trying to run node red via docker compose. I've added the labels and don't see any errors in the logs but when I try to connect via internet, the page displays :
This site can’t be reached
`nodered.******.fr refused to connect.`
`Try:`
* `Checking the connection`
* `Checking the proxy and the firewall`
`ERR_CONNECTION_REFUSED`
and I don't understand why. Here is my compose docker for traefik and the one for my nodered :
nodered.yml :
`version: '3.8'`
`services:`
`node-red:`
`image: nodered/node-red:latest-12-minimal`
`container_name: nodered`
`user: root`
`labels:`
`- "traefik.enable=true"`
`- "traefik.http.routers.node.rule=Host(\`nodered.local`)"`
`- "traefik.http.routers.node.entrypoints=websecure"`
`- "traefik.http.routers.node.tls.certresolver=le"`
`networks:`
`- network-nodered`
`- web`
`volumes:`
`- ./nodered_data:/data`
`restart: unless-stopped`
`networks:`
`network-nodered:`
`web:`
`external:`
`name: web`
traefik. yml :
`version: '3'`
`services:`
`reverse-proxy:`
`image: traefik:v2.9`
`container_name: traefik`
`ports:`
`- "80:80"`
`- "443:443"`
`- "8080:8080"`
`volumes:`
`- /var/run/docker.sock:/var/run/docker.sock`
`- $PWD/traefik.toml:/etc/traefik/traefik.toml`
`- ./acme.json:/acme.json`
`restart: always`
`networks:`
`- web`
`networks:`
`web:`
`external: true`
(my firewall ports are open)
You normally can not use a local domain like nodered.local with LetsEncrypt, as that domain can not be validated.
Share you Traefik static and dynamic config, and docker-compose.yml if used. Use 3 backticks in front and after code, or select the code and use the </> button.
Check a simple Traefik example.
Hello,
Node red.local was for testing, it's normally noter.***.fr.
Here is my traefik. toml :
[api]
dashboard = true
insecure = true
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http]
[entryPoints.web.http.redirections]
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
permanent = true
[entryPoints.websecure]
address = ":443"
[entryPoints.websecure.http.tls]
certResolver = "default"
[providers]
[providers.docker]
watch = true
exposedByDefault = false
network = "web"
[certificatesResolvers]
[certificatesResolvers.le]
[certificatesResolvers.le.acme]
email = "contact@superman.com"
storage = "acme.json"
caServer = "https://acme-v01.api.letsencrypt.org/directory"
[certificatesResolvers.le.acme.tlsChallenge]
and my docker-compose.yml :
version: '3'
services:
reverse-proxy:
image: traefik:v2.9
container_name: traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $PWD/traefik.toml:/etc/traefik/traefik.toml
- ./acme.json:/acme.json
restart: always
networks:
- web
networks:
web:
external: true
i also find this error :
traefik | time="2023-06-20T19:25:00Z" level=error msg="Unable to obtain ACME certificate for domains \"nodered.****.fr\": unable to generate a certificate for the domains [nodered.****.fr]: error: one or more domains had a problem:\n[nodered.*****.fr] acme: error: 400 :: urn:ietf:params:acme:error:connection :: 82.***.***.125: Error getting validation data\n" routerName=node@docker rule="Host(nodered.*****.fr)" providerName=le.acme ACME CA="https://acme-v02.api.letsencrypt.org/directory"
Seems your sub-domain can be resolved to IP, but it can’t be connected to.
The IP could be wrong or a firewall is in the way.
Hello again,
I found the error, I had the wrong ip address when creating my subdomain...