# Can't open the site via TLS

**URL:** <https://community.traefik.io/t/cant-open-the-site-via-tls/10905>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [June 11, 2021, 7:48pm UTC](https://community.traefik.io/t/cant-open-the-site-via-tls/10905 "2021-06-11T19:48:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexanderZhirov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/alexanderzhirov/32/3875_2.png) [@AlexanderZhirov](https://community.traefik.io/u/AlexanderZhirov)\
**Post date:** [June 11, 2021, 7:48pm UTC](https://community.traefik.io/t/cant-open-the-site-via-tls/10905/1 "2021-06-11T19:48:15Z")

</div>

Collected my assembly **traefik** + **apache with php** + **mariadb**. The assembly takes place without problems. All containers start without error. Traefik opens at traefik.localhost, while the site itself at localhost takes a long time to load and gives a Gateway Timeout error. I don’t understand where I went wrong. [Here are the sources.](https://github.com/AlexanderZhirov/egeya_docker)

> **screenshots**
>
> ![2021-06-11_22-13](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/7/76851e432d9b058d809e3681102e6fb22c15a6a5.png)  
> ![2021-06-11_22-12](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/8/844175902435de690f891fac0e53e784b420e09d.png)

---

<div class="post-metadata">

**Author:** ![AlexanderZhirov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/alexanderzhirov/32/3875_2.png) [@AlexanderZhirov](https://community.traefik.io/u/AlexanderZhirov)\
**Post date:** [June 11, 2021, 8:27pm UTC](https://community.traefik.io/t/cant-open-the-site-via-tls/10905/2 "2021-06-11T20:27:30Z")

</div>

Changed this line

`traefik.http.services.egeya.loadbalancer.server.port=8085`

on this

`traefik.port=8085`

And the site began to open. Why?

---

<div class="post-metadata">

**Author:** ![daniel.tomcej](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/daniel.tomcej/32/262_2.png) [@daniel.tomcej](https://community.traefik.io/u/daniel.tomcej)\
**Post date:** [June 11, 2021, 8:46pm UTC](https://community.traefik.io/t/cant-open-the-site-via-tls/10905/3 "2021-06-11T20:46:46Z")

</div>

Hello @AlexanderZhirov,

Please note that the `traefik.port` label is from Traefik v1, and will not work in v2.

It appears that your containers are linked to multiple networks, therefore assigned multiple IP addresses by docker. You need to set the `traefik.docker.network` label ([Docker - Traefik](https://doc.traefik.io/traefik/routing/providers/docker/#traefikdockernetwork)) to let Traefik know which network to use.

This should prevent Traefik from attempting to forward to a network it is not connected to, returning a gateway timeout error.

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [June 11, 2021, 9:47pm UTC](https://community.traefik.io/t/cant-open-the-site-via-tls/10905/4 "2021-06-11T21:47:15Z")

</div>

If adding `traefik.http.services.egeya.loadbalancer.server.port=8085` worked it is because the container either:

- Exposes no port
- Exposes more than 1 port

---

<div class="post-metadata">

**Author:** ![AlexanderZhirov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/alexanderzhirov/32/3875_2.png) [@AlexanderZhirov](https://community.traefik.io/u/AlexanderZhirov)\
**Post date:** [June 11, 2021, 10:52pm UTC](https://community.traefik.io/t/cant-open-the-site-via-tls/10905/5 "2021-06-11T22:52:29Z")

</div>

I took all the parameters in quotes and everything worked for me. I also added names to my networks.

> **Спойлер**
>
> ```auto
> version: "3.7"
> 
> services:
> 
> traefik:
> image: "traefik:latest"
> container_name: "traefik"
> networks:
> - "traefik_net"
> command:
> - "--api.insecure=true"
> - "--providers.docker=true"
> - "--providers.docker.network=traefik_net"
> - "--providers.docker.exposedbydefault=false"
> - "--entrypoints.web.address=:80"
> - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
> - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
> - "--entrypoints.websecure.address=:443"
> - "--certificatesresolvers.myresolver.acme.httpchallenge=true"
> - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
> - "--certificatesresolvers.myresolver.acme.email=localhost@localhost"
> - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
> ports:
> - "80:80"
> - "443:443"
> # - "8080:8080"
> volumes:
> - "/var/volumes-data/letsencrypt:/letsencrypt"
> - "/var/run/docker.sock:/var/run/docker.sock:ro"
> labels:
> - "traefik.enable=true"
> - "traefik.http.middlewares.traefik-compress.compress=true"
> - "traefik.http.middlewares.auth.basicauth.users=test:$$2y$$05$$IXk8apZGeqyrUl.D7twc9uz1WzpQLqvlGgd66c7Oyrou0iFkqs/rS"
> - "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)"
> - "traefik.http.routers.traefik.service=traefik"
> - "traefik.http.services.traefik.loadbalancer.server.port=8080"
> - "traefik.http.routers.traefik.entrypoints=websecure"
> - "traefik.http.routers.traefik.tls.certresolver=myresolver"
> - "traefik.http.routers.traefik.service=api@internal"
> - "traefik.http.routers.traefik.middlewares=traefik-compress,auth"
> 
> egeya:
> image: "egeya:home"
> build:
> context: .
> args:
> PHP_VERSION: "${PHP_VERSION}"
> AEGEYA_VERSION: "${AEGEYA_VERSION}"
> depends_on:
> - "egeyadb"
> container_name: "egeya"
> environment:
> - "VIRTUAL_HOST=${VIRTUAL_HOST}"
> networks:
> - "db_net"
> - "traefik_net"
> # ports:
> # - 8085:80
> volumes:
> - "/var/volumes-data/egeya/theme:/var/www/html/themes/mytheme"
> - "/var/volumes-data/egeya/pictures:/var/www/html/pictures"
> - "/var/volumes-data/egeya/user:/var/www/html/user"
> labels:
> - "traefik.enable=true"
> - "traefik.http.middlewares.egeya-compress.compress=true"
> - "traefik.http.routers.egeya.rule=Host(`localhost`)"
> - "traefik.http.routers.egeya.service=egeya"
> - "traefik.http.services.egeya.loadbalancer.server.port=80"
> - "traefik.http.routers.egeya.entrypoints=websecure"
> - "traefik.http.routers.egeya.tls.certresolver=myresolver"
> - "traefik.http.routers.egeya.middlewares=egeya-compress"
> depends_on:
> - "egeyadb"
> 
> egeyadb:
> image: "mariadb:${MYSQL_VERSION}"
> command: "mysqld --default-authentication-plugin=mysql_native_password"
> restart: "always"
> container_name: "egeyadb"
> environment:
> - "MYSQL_ROOT_PASSWORD=egeya"
> - "MYSQL_DATABASE=egeya"
> networks:
> - "db_net"
> ports:
> - "3306:3306"
> volumes:
> - "/var/volumes-data/egeya/mysql:/var/lib/mysql"
> depends_on:
> - "traefik"
> 
> adminer:
> image: "adminer:latest"
> container_name: "adminer"
> # ports:
> # - "8081:8080"
> labels:
> - "traefik.enable=true"
> - "traefik.http.routers.adminer.rule=Host(`db-admin.localhost`)"
> - "traefik.http.routers.adminer.service=adminer"
> - "traefik.http.services.adminer.loadbalancer.server.port=8080"
> - "traefik.http.routers.adminer.entrypoints=websecure"
> - "traefik.http.routers.adminer.tls=true"
> - "traefik.http.routers.adminer.tls.certresolver=myresolver"
> networks:
> - "traefik_net"
> - "db_net"
> depends_on:
> - "egeyadb"
>       
> networks:
> traefik_net:
> name: "traefik_net"
> db_net:
> name: "db_net"
> 
> ```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [June 14, 2021, 10:53pm UTC](https://community.traefik.io/t/cant-open-the-site-via-tls/10905/6 "2021-06-14T22:53:19Z")

</div>

Closed on June 14, 2021, 10:53pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
