---
title: "Proxy RUM data to Frontend Observability | Grafana Cloud documentation"
description: "Learn how to proxy RUM signals to Grafana Cloud"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Proxy RUM data to Frontend Observability

A proxy can be used to:

- Filter out bots
- Enrich the signals with custom data
- Apply advanced filter techniques to prevent sensitive data from being sent to Grafana Cloud
- Apply advanced sampling techniques to reduce the amount of data sent to Grafana Cloud
- Apply advanced rate limiting techniques to prevent submitting too many user-sessions to Grafana Cloud
- Hide the original ingest token into Grafana Cloud to obscure it from clients
- Receive signals on the same domain as your application, so you don’t have to list each origin under **CORS Allowed Origins**

## Requirements for the proxy

To avoid listing origins under **CORS Allowed Origins**, host the proxy on the same origin as each page that sends signals, for example as a `/faro-proxy` path on each domain. A proxy on a separate host receives cross-origin requests, so the browser still applies CORS to them.

Any proxy technology can be used, as long as it transparently forwards all headers to and from the Grafana Cloud collector endpoint and sets a `X-Forwarded-For` header to communicate the client IP to the endpoint.

## Example (nginx)

An nginx implementation could be as simple as introducing a new location block that handles and forwards to your collector endpoint:

nginx ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```nginx
location ~ ^/faro-proxy(.*)$ {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;

  proxy_ssl_server_name on;
  resolver          8.8.8.8 8.8.4.4 ipv6=off;
  resolver_timeout  5s;

  # customize this line with the hostname of your collector
  set $faro "faro-collector-prod-us-central-0.grafana.net";

  proxy_pass https://$faro/collect$1;
}
```

In your JavaScript initialization code, you should now be able to use the proxy host instead of the hosted collector and the proxy should reverse-proxy between Grafana Cloud and the users’ browser.

Before: `https://faro-collector-prod-us-central-0.grafana.net/collect/12345abcdefg`

After: `https://my-proxy-host.net/faro-proxy/12345abcdefg`

## Reading further

- [Learn how to rate limit clients with nginx](https://www.nginx.com/blog/rate-limiting-nginx/)
