title: Traefik v2 not routing with the path but working with ip
body: <p>I have 3 VM machines running in a docker swarm, my docker-compose file works perfectly when I build it on one VM machine, but when I deploy the stack and want to work in swarm mode Traefik detects the containers and services but the router does not work with the paths I mentioned inside the docker-compose file.
      this is my docker-compose file :</p>
  
  <pre><code>    version: "3"
  
      volumes:
        prometheus_data: {}
  
      services:
          joomla:
              image: erfanemoon/joomla_img
              hostname: joomla
              ports:
                 - 8081:80
                 #- 81:81
              deploy:
                  mode: replicated
                  replicas: 1
                  placement:
                     constraints:
                      - node.role == worker
                  labels:
                    - "traefik.enable=true"
                    - "traefik.http.routers.joomla.rule=Host(`joomla.localhost`)"
                    - "traefik.http.routers.joomla.priority=49"
                    - "traefik.http.routers.joomla.entrypoints=web"
                    #- "traefik.http.services.joomla.loadbalancer.server.port=80"
              entrypoint: ["wait-for-it.sh", "-t", "120", "db:3306", "--", "docker-php-entrypoint", "-D FOREGROUND"]
              depends_on:
                  - db
              volumes:
                  - /gfs/joomla/:/var/www/html/
              networks:
                  - intnet
                  #- extnet  
   pmy:
          image: phpmyadmin/phpmyadmin
          hostname: pmy
          depends_on:
             - db
          ports:
              - 8082:80
          deploy:
              mode: replicated
              replicas: 1
              placement:
                 constraints:
                  - node.role == worker
              labels:
                - "traefik.enable=true"
                - "traefik.http.routers.pmy.rule=Host(`pmy.localhost`)"
                - "traefik.http.routers.pmy.priority=50"
                - "traefik.http.routers.pmy.entrypoints=web"
                - "traefik.http.services.pmy.loadbalancer.server.port=80"
          environment:
              DB_HOST: db
              MYSQL_ROOT_PASSWORD: qweasd
          volumes:
              - /gfs/phpmyadmin:/config
          networks:
              - intnet
              #- extnet  
  
   db:
          image: mariadb
          command: --default-authentication-plugin=mysql_native_password
          hostname: db
          ports:
             - 3306:3306
          environment:
              MYSQL_ROOT_PASSWORD: qweasd
          volumes:
              - /gfs/mysql:/var/lib/mysql
          networks:
              - intnet
              #- extnet  
  
  
      traefik:
              image: "traefik:v2.0.0-rc3"
              hostname: traefik
              command:
                  - "--api=true"
                  - "--api.debug=true"
                  - "--api.insecure=true"
                  #- --providers.docker=true  
                  #- --traefik.http.routers.traefik.rule=Host(`traefik.localhsot`)  
                  - "--providers.docker.endpoint=unix:///var/run/docker.sock"
                  - "--providers.docker.swarmMode=true"
                  - "--providers.docker.exposedbydefault=false"
                  - "--providers.docker.network=app_intnet"
                 #- --providers.docker.network=app_extnet  
                  - "--entrypoints.web.address=:80"
              ports:
                  - "80:80"
                  - "8080:8080"
              volumes:
                  - /var/run/docker.sock:/var/run/docker.sock:ro
                 #- /home/erfan/joomla/data/traefik.yml:/traefik.yml:ro
                 #- /home/erfan/joomla/data/acme.json:/acme.json  
              deploy:
                  placement:
                      constraints:
                          - node.role == manager
              networks:
                 - intnet
                 - extnet
      networks:
           intnet:
              internal: true
              driver: overlay
              ipam:
                driver: default
                config:
                    - subnet: 192.168.200.0/24
           extnet:
             driver: overlay
             #external: true
             ipam:
               driver: default
               config:
                   - subnet: 192.168.100.0/24
  </code></pre>
  
  <p>and these are docker networks : </p>
  
  <pre><code>     NETWORK ID          NAME                DRIVER              SCOPE
          ukzzfno60hbc        app_extnet          overlay             swarm
          qtj33re0udg1        app_intnet          overlay             swarm
          7a29fd57a6e7        bridge              bridge              local
          01595efaa286        docker_gwbridge     bridge              local
          96be2c7598cf        host                host                local
          26migzlan45q        ingress             overlay             swarm
          b54bbc08d908        none                null                local
  </code></pre>
  
  <p>when I enter :
  joomla.localhost  or  pmy.localhost, it does not open the page but when I enter the IP address it is working and I don't understand why it is happening, would be glad if anyone can help me </p>