# Cloudflare Tunnel (Zero Trust)

A [Cloudflare tunnel ](https://www.cloudflare.com/nl-nl/products/tunnel/)can be used as a reverse proxy in front of Speedtest Tracker when you want to expose the application publicly without exposing your IP address.

### Cloudflare Tunnel Configuration

* Update your `APP_URL` to the public URL you are going to use and restart the service.
* In the Cloudflare panel go to **Zero Trust** -> **Networks** -> **Tunnels** page.
* For the tunnel you want to add the Speedtest Tracker to click on **Edit** or add a new tunnel.
* Go to **Public Hostname.**
* Click on **Add a public hostname.**
* Fill in the following fields.
  * **Subdomain:** The subdomain you want to access the Speedtest Tracker on.
  * **Domain:** The domain you want to access the Speedtest Tracker on.
  * **Type:** Connection type to the Speedtest Tracker (http/https)
    * When choosing HTTPS you will need to disable the TLS verification under `Additional application settings -> TLS -> No TLS Verify`
  * **URL:** The URL to access the Speedtest Tracker. This can be either the IP Address:Port or the container\_name:port.

{% hint style="info" %}
When using the container\_name Cloudflare Tunnel and Speedtest Tracker need to be on the same Docker network.
{% endhint %}

<figure><img src="/files/DKnMY6GYdbj6gZiNkGZN" alt=""><figcaption></figcaption></figure>

### Docker Configuration

Docker-Compose:

```yaml
services:
    speedtest-tracker:
        container_name: speedtest-tracker
        environment:
            - PUID=1000
            - PGID=1000
            - APP_KEY=
            - DB_CONNECTION=sqlite
            - SPEEDTEST_SCHEDULE=
            - SPEEDTEST_SERVERS=
            - PRUNE_RESULTS_OLDER_THAN=
            - CHART_DATETIME_FORMAT= 
            - DATETIME_FORMAT=
            - APP_TIMEZONE=
            - APP_URL=https://speedtest.yourdomain.com # Change this to your domain name
            - ASSET_URL=https://speedtest.yourdomain.com # Change this to your domain name
        volumes:
            - /path/to/data:/config
            - /path/to-custom-ssl-keys:/config/keys
        image: lscr.io/linuxserver/speedtest-tracker:latest
        restart: unless-stopped
```

{% hint style="info" %}
Depending on your Cloudflare Tunnel configuration, you need to make sure the Speedtest Tracker and Cloudflare Tunnel are on the same docker network.
{% endhint %}

<table><thead><tr><th width="291">Added compose part</th><th>Description</th></tr></thead><tbody><tr><td><code>APP_URL</code></td><td>URL you want to access the WebGui on.</td></tr><tr><td><code>ASSET_URL</code></td><td>URL used for loading all the needed assets. Need to be the same as the <code>APP_URL</code>.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.speedtest-tracker.dev/other/proxies/cloudflare-tunnel-zero-trust.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
