# Elastic APM cloud allowing request from a dev env localhost

**URL:** <https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536>\
**Category:** Elastic Agent\
**Created:** [January 22, 2025, 7:34pm UTC](https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536 "2025-01-22T19:34:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre\_Pereira1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_pereira1/32/140420_2.png) [@Andre\_Pereira1](https://discuss.elastic.co/u/Andre_Pereira1)\
**Post date:** [January 22, 2025, 7:34pm UTC](https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536/1 "2025-01-22T19:34:38Z")

</div>

I'm using elastic cloud.  
I am requesting assistance enabling **Cross-Origin Resource Sharing (CORS)** for `http://localhost:8080` on our APM server.  
how can I configure the APM server to allow requests from a test localhost instance?

We are currently developing and testing applications locally, and our frontend running on `http://localhost:8080` needs to send data to the APM server. However, we are encountering CORS-related issues, as the APM server does not currently allow requests from this origin.

```auto
apm-server:
  cors:
    enabled: true
    allow_origins: ['http://localhost:8080']
    allow_headers: ['Authorization', 'Content-Type', 'Content-Encoding']

```

Here are the relevant details:

- **APM Server URL** : `https://pamp-dc8943.kb.us-east-1.aws.elastic.cloud`
- **Origin to Allow** : `http://localhost:8080`

Kind regards

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [January 22, 2025, 10:58pm UTC](https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536/2 "2025-01-22T22:58:21Z")

</div>

Hi @Andre_Pereira1 Welcome to the community!

> [@Andre\_Pereira1](#):
>
> Im using elastic cloud, how can I configure de server to allow request from a test localhost instance?

what is the "de server"?

Apologies it is not clear what you are trying to accomplish.

What version are you on?

What architecture are you trying to support?

Are you trying to have a local APM server connect to Elastic Cloud?

What can not connect another APM server or an APM Language Agent?

> **[Get started with APM | Elastic Observability \[8.17\] | Elastic](https://www.elastic.co/guide/en/observability/current/apm-getting-started-apm-server.html)**

---

<div class="post-metadata">

**Author:** ![Andre\_Pereira1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_pereira1/32/140420_2.png) [@Andre\_Pereira1](https://discuss.elastic.co/u/Andre_Pereira1)\
**Post date:** [January 23, 2025, 9:44am UTC](https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536/3 "2025-01-23T09:44:03Z")

</div>

Hi @stephenb ,  
Thank you for your feedback, I’ve reformulated the question to explain the issue better. Please let me know if it’s clear or if you need any additional details.

Regards,

---

<div class="post-metadata">

**Author:** ![koalageddon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/koalageddon/32/140894_2.png) [@koalageddon](https://discuss.elastic.co/u/koalageddon)\
**Post date:** [January 23, 2025, 12:29pm UTC](https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536/4 "2025-01-23T12:29:44Z")

</div>

To allow requests from a localhost dev environment in Elastic APM Cloud, configure the `server_url` to point to your APM server and ensure CORS is enabled for localhost in the APM settings.

---

<div class="post-metadata">

**Author:** ![Andre\_Pereira1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_pereira1/32/140420_2.png) [@Andre\_Pereira1](https://discuss.elastic.co/u/Andre_Pereira1)\
**Post date:** [January 24, 2025, 8:52am UTC](https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536/5 "2025-01-24T08:52:59Z")

</div>

Thank you for your response. However, I am using **Elastic Cloud** , and I cannot find the option to configure CORS settings for the APM server. It seems that Elastic Cloud does not provide direct access to the `apm-server.yml` file or a UI to modify advanced configurations like CORS.

Could you please advise on how to enable CORS for `http://localhost:8080` in an Elastic Cloud environment? Is there an alternative approach or workaround to allow requests from a localhost development environment?

Here are the details of my setup:

- **APM Server URL** : `https://pamp-dc8943.kb.us-east-1.aws.elastic.cloud`
- **Origin to Allow** : `http://localhost:8080`

Kind regards,

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [January 24, 2025, 2:44pm UTC](https://discuss.elastic.co/t/elastic-apm-cloud-allowing-request-from-a-dev-env-localhost/373536/6 "2025-01-24T14:44:32Z")

</div>

Hi @Andre_Pereira1

I would like to help .. and I can... but I need your help.

Exactly what version of Elastic Cloud are you on?

And what APM Schema are you on?

Kibana -\> APM -\> Settings \> Schema

I need these two answers

Next

> [@Andre\_Pereira1](#):
>
> [https://pamp-dc8943.kb.us-east-1.aws.elastic.cloud](https://pamp-dc8943.kb.us-east-1.aws.elastic.cloud)

That is not the APM URL .. that is the Kibana URL

The APM URL would be

```auto
https://pamp-dc8943.apm.us-east-1.aws.elastic.cloud

```

Note the `apm` vs `kb` perhaps you Are trying to send davida to the wrong endpoint.

I suspect your issues is that you have the RUM agent pointing to Kibana not the APM Endpoint

Per the docs

> **[Configure CORS | APM Real User Monitoring JavaScript Agent Reference \[5.x\] |...](https://www.elastic.co/guide/en/apm/agent/rum-js/current/configuring-cors.html)**

> A list of permitted origins can be supplied to the apm-server.rum.allow\_origins configuration option. By default, APM Server allows all origins.

FInally if you are using the new Elastic Integration

Go to  
Fleet -\> Agent Policies -\> Elastic Cloud Agent =\> Edit Elastic APM

And you will see the cors setting which is already set to all origins  
I suspect your issues is that you have the RUM agent pointing to Kibana not the APM Endpoint

 ![Screenshot 2025-01-24 at 7.42.06 AM](https://us1.discourse-cdn.com/elastic/original/3X/3/7/379b8626d1ecc8f9168ed4a3a34a876e15c12d35.png)
