---
title: "Configure the connection URL | Grafana Labs"
description: "Enter the query URL for your Loki backend using the format that matches your environment."
---

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

# Configure the connection URL

The connection URL tells Grafana where to send log queries. The format depends on your Loki environment.

Use the URL format that matches your backend:

Expand table

| Environment             | URL format                 | Example                             |
|-------------------------|----------------------------|-------------------------------------|
| Self-managed Loki       | `http://<host>:3100`       | `http://loki:3100`                  |
| Grafana Cloud Logs      | Copy from the Cloud Portal | `https://logs-prod-006.grafana.net` |
| Grafana Enterprise Logs | URL of your GEL gateway    | `https://gel.example.com`           |

For **Grafana Cloud Logs**, copy the exact query URL from the Loki details page in the Cloud Portal — don’t assume the `https://logs-prod-<zone>.grafana.net` pattern, since some stacks use nested or legacy hostnames. `https://logs-prod-006.grafana.net` is one example.

To configure the connection URL, complete the following step:

1. In the **URL** field under the **Connection** section, enter the query URL for your Loki backend.
   
   For example, for Grafana Cloud Logs, enter a URL like `https://logs-prod-006.grafana.net`. For self-managed Loki, enter a URL like `http://loki:3100`.
   
   **Tip:** Enter only the base URL. Don’t append API paths such as `/loki/api/v1/push` — that endpoint is for *sending* logs to Loki (with an agent like Grafana Alloy), not for querying, and appending it is a common cause of a failed **Save &amp; test**. To send logs *to* Loki, refer to [Send log data to Loki](/docs/loki/latest/send-data/).

In the next milestone, you configure authentication for the connection.

* * *

### More to explore (optional)

- [Configure the Loki data source](/docs/grafana/latest/datasources/loki/configure/)
- [Network security for data sources](/docs/grafana-cloud/connect-externally-hosted/data-sources/)
