# Connection refused on port :80

**URL:** <https://community.traefik.io/t/connection-refused-on-port-80/6728>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [July 1, 2020, 4:50pm UTC](https://community.traefik.io/t/connection-refused-on-port-80/6728 "2020-07-01T16:50:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![0x113](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/0x113/32/2255_2.png) [@0x113](https://community.traefik.io/u/0x113)\
**Post date:** [July 1, 2020, 4:50pm UTC](https://community.traefik.io/t/connection-refused-on-port-80/6728/1 "2020-07-01T16:50:39Z")

</div>

Hi!

I recently started project based on microservices architecture and I have problem with calling from service A service B. I set up docker-compose and traefik, but I have problem with calling it when I use docker. Here is code, where I send request from service A (`auth svc`) to service B(`user svc`)

```auto
req, err := http.NewRequest(http.MethodPost, http://127.0.0.1/api/v1/user/validate", bytes.NewBuffer(jsonCreds))
if err != nil {
    log.Errorf("Couldn't prepare request: %v", err)
    return nil, err
}
req.Header.Set("Content-Type", "application/json")
req.Host = "usersvc"
res, err := s.httpClient.Do(req)
if err != nil {
    log.Errorf("Couldn't to execute request: %v", err)
    return nil, err
}

```

When I run service A and service B separately and call `http://127.0.0.1/api/v1/user/validate` with `Host=usersvc` everything works ok, but when I want to execute the same code when I use `docker-compose up` I get this error: `{"level":"error","msg":"Couldn't to execute request: Post \"[``http://127.0.0.1/api/v1/user/validate\](http://127.0.0.1/api/v1/user/validate)``": dial tcp`[`127.0.0.1:80`](https://127.0.0.1:80/) `: connect: connection refused","time":"2020-07-01T14:59:58Z"}` .

Here is my `docker-compose.yml`: [https://pastebin.com/Jkuxj8n6](https://pastebin.com/Jkuxj8n6).  
I'm trying call from the `xmedia-auth-svc` to the `xmedia-user-svc`

I guess there is problem with networking, but I don't really know how to fix it. How can I call that service using traefik in docker?

Thanks in advance for the help!

---

<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:** [July 1, 2020, 10:36pm UTC](https://community.traefik.io/t/connection-refused-on-port-80/6728/2 "2020-07-01T22:36:31Z")

</div>

Welcome to the forum @0x113

When they are running in the container the localhost 127.0.0.1 is the container itself _not_ the host that docker runs on.

Compose should have put these all on the same network, inter container communication will work just fine using the container-name. So if I read your configuration correctly your service should use [http://xmedia-user-svc/api/v1/](http://xmedia-user-svc/api/v1/).....

---

<div class="post-metadata">

**Author:** ![0x113](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/0x113/32/2255_2.png) [@0x113](https://community.traefik.io/u/0x113)\
**Post date:** [July 2, 2020, 9:52am UTC](https://community.traefik.io/t/connection-refused-on-port-80/6728/3 "2020-07-02T09:52:56Z")

</div>

Thank you, it worked!
