---
title: "Automatically inject the RUM SDK into your sites | Grafana Cloud documentation"
description: "Learn how to automatically inject the Grafana RUM SDK into your site"
---

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

# Automatically inject the RUM SDK into your sites

Sometimes you cannot add the RUM SDK snippet to an application. This could be because a different internal team owns the app or because the app is in maintenance mode.

This document highlights a strategy that you can use to inject the snippet, so that you can still use Grafana Faro in these scenarios.

> Note
> 
> We recommend directly adding the Web SDK to the applications, so they can use the SDK to augment the automatically created telemetry.

## Requirements

This approach requires a reverse proxy technology that sits in front of the served application and can modify the response content.

## Example (nginx)

An nginx implementation could be as simple as adding a `sub_filter` directive to the location that is used to reverse-proxy the application.

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

```nginx
location / {
    # example value
    proxy_pass http://app:8080/;

    # we match the closing `head` tag and append a script snippet
    sub_filter '</head>' '</head>
    <!-- replace the next line with the "CDN" snippet from the Configuration page -->
    <script></script>';
    sub_filter_once on;
}
```

## Learn more

- Learn more about the `sub_filter` directive in the [nginx `sub_module` documentation](https://nginx.org/en/docs/http/ngx_http_sub_module.html).
- Refer to [complete nginx configuration](https://github.com/cedricziel/grafana-java-demo/blob/main/docker/nginx/default.conf).
