# Heartbeat behind proxy

**URL:** <https://discuss.elastic.co/t/heartbeat-behind-proxy/301194>\
**Category:** Beats\
**Tags:** docker, heartbeat\
**Created:** [March 31, 2022, 12:54pm UTC](https://discuss.elastic.co/t/heartbeat-behind-proxy/301194 "2022-03-31T12:54:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sulfred](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sulfred/32/101276_2.png) [@sulfred](https://discuss.elastic.co/u/sulfred)\
**Post date:** [March 31, 2022, 12:54pm UTC](https://discuss.elastic.co/t/heartbeat-behind-proxy/301194/1 "2022-03-31T12:54:31Z")

</div>

I am running heartbeat in a container. The version of the heartbeat is heartbeat:8.1.0. My heartbeat is running behind the proxy and output to the elastic cloud.

In the `docker-compose.yml`

```auto
environment:
  HTTP_PROXY: "http://xxxxx:port"
  http_proxy: "http://xxxxxxx:port"
  HTTPS_PROXY: "https://xxxxx:port"
  https_proxy: "https://xxxxx:port"

```

In the `heartbeat.yml`

```auto
cloud.id: "xxxxxxxxxxxxx"
cloud_auth: xxxxxxxxxxxxxxxxxxx

```

Once I bring up the beat, I get error:

```auto
Error dialing EOF

```

I would like to ask what is the correct way to set up the proxy for heartbeat ?  
Also, what is the possible issue that cause this error?

Thanks

---

<div class="post-metadata">

**Author:** ![emilioalvap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emilioalvap/32/99310_2.png) [@emilioalvap](https://discuss.elastic.co/u/emilioalvap)\
**Post date:** [April 1, 2022, 2:50pm UTC](https://discuss.elastic.co/t/heartbeat-behind-proxy/301194/2 "2022-04-01T14:50:20Z")

</div>

Hi @sulfred,

Thanks for raising this issue. Just to clarify, the required proxy lives between heartbeat container and ES?

If that's the case, this configuration should work:

```auto
output.elasticsearch:
  proxy_url: "http://host.docker.internal:3128" --> Local proxy test

cloud.id: "xxxxxxxxxxx"
cloud.auth: "xxxxxxxxxxx"

```

`HTTP_PROXY` environment variable is probably picked up by the underlying Go libraries and applying to all requests, including those to the monitored endpoints.

---

<div class="post-metadata">

**Author:** ![sulfred](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sulfred/32/101276_2.png) [@sulfred](https://discuss.elastic.co/u/sulfred)\
**Post date:** [April 3, 2022, 11:15pm UTC](https://discuss.elastic.co/t/heartbeat-behind-proxy/301194/4 "2022-04-03T23:15:03Z")

</div>

Thanks, this is working

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 2, 2022, 1:15am UTC](https://discuss.elastic.co/t/heartbeat-behind-proxy/301194/5 "2022-05-02T01:15:55Z")

</div>

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