Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pages/agent-network/existing-self-hosted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@ curl https://<your-endpoint>/v1/messages \
```

The checks below assume one proxy serves both your Reverse Proxy services and the agent network
endpoint, as set up in this guide. On a separate proxy cluster, skip the first check; the `403`
endpoint, as set up in this guide. On a separate proxy cluster, skip the first check; the refusal
results were not verified there, and a request that reaches a different proxy may get a different
error.

- Open one of your existing Reverse Proxy services. It still works.
- From a peer in the policy's source group, the request returns `200` with the provider's reply,
without any provider key on the peer.
- From a peer outside the source group, or from a machine that is not a NetBird peer, the same
request returns `403`.
- From a peer outside the source group, the same request returns `401`. From a machine that is not
a NetBird peer, it returns `404`.

So the endpoint is reachable from the internet, but only to be refused. Its hostname is in public
DNS, and a request from outside NetBird reaches your server and gets `403`, never a reply from the
DNS, and a request from outside NetBird reaches your server and gets `404`, never a reply from the
provider. Only peers in the policy's source group get through: NetBird DNS resolves the hostname
for them to the proxy's NetBird address.

Expand Down
5 changes: 3 additions & 2 deletions src/pages/agent-network/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ reverse:
always recorded; a full access-log entry is written when log collection is on. See
[Usage and Access Logs](#usage-and-access-logs).

A denial at any gate returns `403` to the client with a machine-readable reason, and the
request is still recorded so it appears in your logs.
A peer outside every Agent Network policy is refused at the first gate with `401`. A denial at
a later gate returns `403` with a machine-readable reason. Either way, the request is still
recorded so it appears in your logs.

## Identity and Authentication

Expand Down
5 changes: 3 additions & 2 deletions src/pages/agent-network/integrations/agentgateway.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ key and trusted identity headers, and forwards the request to agentgateway.

If a request fails, check both systems:

- A `403` from the Agent Network endpoint usually means the peer is not authorized by the
selected NetBird policy.
- A `401` from the Agent Network endpoint usually means the peer is not in the source groups of
any NetBird policy. A `403` means a later policy check refused it, for example because no
provider is authorized for the peer.
- A `401` from agentgateway usually means the raw virtual key stored in NetBird does not
match the hash configured in agentgateway.
- A model routed with zero cost usually needs an explicit model and pricing row in NetBird.
Expand Down
2 changes: 1 addition & 1 deletion src/pages/manage/reverse-proxy/access-logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Every log entry (HTTP and L4) shares a common set of fields. Some fields are onl
| **Location** | Country, city, and subdivision based on source IP geolocation | Yes | Yes |
| **Auth Method** | Raw `auth_method_used` value: `oidc` (shown as SSO in the dashboard), `password`, `pin`, `header`, or a target access action such as `path_bypass` or `path_block`. When an access restriction rejects the request, carries the restriction code instead (e.g. `ip_restricted`, `crowdsec_ban`). Omitted from the API response when empty | Yes | Restriction code on denials |
| **User** | The authenticated user's ID, set when `oidc` authentication was used. Omitted from the API response when empty | Yes | N/A |
| **Reason** | Derived from the HTTP response status: `Authentication failed` for `401`/`403`, or `Request failed` for other `4xx`/`5xx` responses. This includes responses from the backend. Omitted when empty. For specific restriction codes, see [Deny reasons](#deny-reasons) | Yes | Omitted |
| **Reason** | Derived from the HTTP response status: `Authentication failed` for `401`/`403`, and for a `404` or `503` with which the proxy refuses a [NetBird-Only](/manage/reverse-proxy/authentication#net-bird-only-access-private-services) request, or `Request failed` for other `4xx`/`5xx` responses. This includes responses from the backend. Omitted when empty. For specific restriction codes, see [Deny reasons](#deny-reasons) | Yes | Omitted |
| **Metadata** | Additional decision details. Target access records `access_action` as `bypass`, `block`, or `invalid_path` (an ambiguous request path rejected with `400`); CrowdSec records its mode and verdict here | Yes | Yes |

## Understanding log entries
Expand Down
8 changes: 4 additions & 4 deletions src/pages/manage/reverse-proxy/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NetBird-Only Access is mutually exclusive with the operator auth methods on the
NetBird-Only Access restricts the service to peers running inside your own NetBird network. Unlike SSO or password, there is no login page — the proxy verifies the client through its WireGuard tunnel before serving any traffic. Clients that are not on a NetBird peer in your account cannot reach the service at all.

<Note>
NetBird supplies authorized peers with private DNS records pointing service hostnames to the proxy's NetBird address. Browsers using a separate DNS-over-HTTPS resolver can receive the public address instead and display `403 Forbidden`, even while the device is connected. See [403 Forbidden with NetBird-Only Access](/manage/reverse-proxy/troubleshooting#issue-5-403-forbidden-with-net-bird-only-access) for DNS checks and browser settings.
NetBird supplies authorized peers with private DNS records pointing service hostnames to the proxy's NetBird address. Browsers using a separate DNS-over-HTTPS resolver can receive the public address instead and display **Service Not Found** (`404`), even while the device is connected. See [NetBird-Only service refuses requests](/manage/reverse-proxy/troubleshooting#issue-5-net-bird-only-service-refuses-requests) for DNS checks, browser settings, and what each refusal status means.
</Note>

<p>
Expand All @@ -39,7 +39,7 @@ NetBird-Only Access restricts the service to peers running inside your own NetBi
**How it works:**

1. The proxy receives an inbound HTTP request and resolves the source address back to a NetBird peer using its embedded `netbird proxy` client. Requests with no peer-of-origin are rejected.
2. The calling peer's groups are checked against the service's **access groups**. If none match, the request is rejected with `403`. If the peer has a user owner, that user must also belong to the service's account and must not be blocked or pending approval.
2. The calling peer's groups are checked against the service's **access groups**. If the peer has a user owner, that user must also belong to the service's account and must not be blocked or pending approval. A refused request gets `404`, `403`, or `401` depending on the caller; see [refusal status codes](/manage/reverse-proxy/troubleshooting#issue-5-net-bird-only-service-refuses-requests).
3. The request is forwarded to the backend with the available identity headers — see [Identity headers stamped on upstream requests](#identity-headers-stamped-on-upstream-requests).

By default the proxy reaches the backend over the encrypted WireGuard tunnel through a NetBird peer — the service is reachable only from inside your NetBird network, and access is gated by group membership:
Expand All @@ -48,7 +48,7 @@ By default the proxy reaches the backend over the encrypted WireGuard tunnel thr
flowchart LR
Client["Client peer"] -->|WireGuard| Proxy["Proxy cluster"]
Proxy -.->|Validate peer and group membership| Management["Management service"]
Proxy -->|Denied| Denied["403"]
Proxy -->|Denied| Denied["404 / 403 / 401"]
Proxy -->|Allowed over WireGuard| Peer["Backend NetBird peer"]
Peer --> Backend["Backend service"]
```
Expand Down Expand Up @@ -194,7 +194,7 @@ HTTP targets can override the service authentication behavior for their matching
|--------|----------|
| **Use service authentication** | Apply the authentication configured on the service. This is the default. |
| **Bypass authentication** | Skip SSO, password, PIN, and header authentication for requests routed to this target. Service-level access restrictions still apply. |
| **Block access** | Return `403` for requests routed to this target without contacting its backend. |
| **Block access** | Return `403` for requests routed to this target without contacting its backend. On a NetBird-Only service, callers that are not peers of the account get `404`. |

<p>
<img src="/docs-static/img/manage/reverse-proxy/authentication/target-access-setting.png" alt="Edit Target modal with Optional Settings expanded, showing the Access dropdown and its three options: Use service authentication, Bypass authentication, and Block access" className="imagewrapper"/>
Expand Down
31 changes: 24 additions & 7 deletions src/pages/manage/reverse-proxy/troubleshooting.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {Note} from "@/components/mdx"

export const description = 'Troubleshoot NetBird reverse proxy issues, including 403 errors with NetBird-Only Access, browser DNS conflicts, and unreachable backends.'
export const description = 'Troubleshoot NetBird reverse proxy issues, including refused requests (404, 403, 401) with NetBird-Only Access, browser DNS conflicts, and unreachable backends.'

# Reverse Proxy Troubleshooting

This guide helps you diagnose and resolve common reverse proxy issues in NetBird. Follow the structured approach below to identify and fix problems quickly.

If a service behind a routing peer is unreachable in general (not specific to the reverse proxy), see [Troubleshooting resource connectivity](/help/troubleshooting-resource-connectivity) to find which layer is dropping the traffic.

If a NetBird-Only service returns `403 Forbidden`, especially when `curl` works but a browser fails, start with [403 Forbidden with NetBird-Only Access](#issue-5-403-forbidden-with-net-bird-only-access).
If a NetBird-Only service returns `404`, `403`, or `401`, especially when `curl` works but a browser fails, start with [NetBird-Only service refuses requests](#issue-5-net-bird-only-service-refuses-requests). A `404` there can mean the caller has no access, not only that the service does not exist.

## Quick Diagnostics Checklist

Expand Down Expand Up @@ -324,13 +324,30 @@ A service's status reflects the proxy's listener, not the backend: a TCP service

Check the backend, not the service status: on the target host, confirm that the application is listening on the target port and binds to an interface the proxy can reach (step 6 of the [Quick Diagnostics Checklist](#quick-diagnostics-checklist), and Issue 2).

### Issue 5: 403 Forbidden with NetBird-Only Access
### Issue 5: NetBird-Only service refuses requests

**Symptoms**:

- A service with **NetBird-Only Access** returns `403 Forbidden` even though the client is connected and belongs to an allowed peer group.
- A service with **NetBird-Only Access** returns `404`, `403`, `401`, or `503`, even though the client is connected.
- The same URL may work with `curl` or another browser, while the affected browser still fails in a private window.

The proxy picks the status of a refusal by who is asking, so a caller that cannot reach any private service cannot tell that the service exists. Older proxy versions return `403` for every refusal.

| Status | Caller | What to check |
|--------|--------|---------------|
| `404` | Not a peer of the service's account: no NetBird connection, a request that reached the proxy's public address, or a peer of another account | That the request reaches the proxy over the NetBird tunnel. See the connection check below. |
| `404` | A peer of the account that can reach no private service, or whose user owner is blocked or pending approval | The peer's groups against the service's [access groups](/manage/reverse-proxy/authentication#net-bird-only-access-private-services), and the owner's status under **Users**. |
| `403` | A peer of the account that is not in this service's access groups but can reach another private service | The peer's groups against this service's access groups. |
| `403` or `404` | Refused by an IP restriction or a blocked target path: `403` for a peer of the account, `404` for any other caller | The service's CIDR allowlists and blocklists (they apply to tunnel traffic too) and the target's **Access** setting. |
| `401` | A peer outside every Agent Network policy (Agent Network endpoint only) | The source groups of your [Agent Network policies](/agent-network/policies). The response has no `WWW-Authenticate` header, so LLM SDKs and agent CLIs may report an invalid API key or ask you to log in again. A request refused because no provider is authorized for the caller still returns `403`. |
| `503` | Any caller, while the proxy cannot reach the management service to validate the peer | The proxy's connection to the management service and the proxy logs. |

With a management service older than the proxy, the proxy cannot tell whether a peer reaches another private service, so it returns `404` where the table shows `403`.

<Note>
A `404` from a NetBird-Only service does not always mean that the service or its DNS record is missing. The proxy shows a refused caller the same **Service Not Found** page as an unknown hostname. Before you troubleshoot DNS, find the request in the service's [access logs](/manage/reverse-proxy/access-logs): a refusal is logged with the reason `Authentication failed`.
</Note>

NetBird supplies authorized peers with private DNS records pointing the service hostname to the proxy's NetBird address. The request must reach the proxy over the NetBird tunnel so it can identify the calling peer. Browser DNS-over-HTTPS (DoH) can bypass the system's NetBird DNS configuration. If the browser receives the public address instead, it reaches the public endpoint and fails the tunnel check. A private browsing window does not necessarily change the browser's DNS settings.

**Check the connection from the affected device**:
Expand All @@ -342,7 +359,7 @@ curl -v --noproxy '*' https://service.example.com/

Replace `service.example.com` with the service hostname. The `--noproxy` option makes this a direct test, ignoring any HTTP proxy configured for curl. Inspect the `Trying` and `Connected to` lines: the destination should be one of the proxy cluster's NetBird addresses, rather than the public address of your proxy host or wildcard DNS record.

The browser may still use an HTTP proxy configured in its own or the system's proxy settings, even when direct curl succeeds. That proxy may reach the service through its public endpoint, causing a 403 because the request lacks the calling peer's tunnel identity. Check those proxy settings and, if your organization's policy permits, bypass the proxy for the service hostname. Changing browser DNS settings alone may not fix a request routed through an HTTP proxy.
The browser may still use an HTTP proxy configured in its own or the system's proxy settings, even when direct curl succeeds. That proxy may reach the service through its public endpoint, causing a `404` because the request lacks the calling peer's tunnel identity. Check those proxy settings and, if your organization's policy permits, bypass the proxy for the service hostname. Changing browser DNS settings alone may not fix a request routed through an HTTP proxy.

If curl succeeds over the NetBird address but one browser fails, check that browser's DNS settings. Curl's result does not establish which resolver or destination the browser uses. If curl also resolves to the public address or cannot resolve the hostname, check that the client uses [NetBird-managed DNS](/manage/dns/troubleshooting#first-confirm-the-peer-is-in-managed-mode).

Expand All @@ -356,12 +373,12 @@ To confirm the cause in Firefox, you can temporarily set DNS over HTTPS to **Off

After changing either browser's settings, clear its DNS cache or fully restart it before retrying while connected to NetBird.

**If any client still receives 403**:
**If any client is still refused**:

- Confirm that the calling **peer**, not just its user, belongs to a service access group. See [NetBird-Only access groups](/manage/reverse-proxy/authentication#net-bird-only-access-private-services).
- Check the service's CIDR allowlists and blocklists against the caller's NetBird address. These restrictions still apply to tunnel traffic.
- If you use a custom account IP range, check the deployed proxy version's address requirements. The current [tunnel authentication check](https://github.com/netbirdio/netbird/blob/main/proxy/internal/auth/middleware.go) accepts RFC1918 private IPv4, IPv6 ULA, and the default CGNAT range (`100.64.0.0/10`); addresses outside those ranges fail that check.
- Use the [access logs](/manage/reverse-proxy/access-logs#deny-reasons) and backend logs to identify which component returned the 403. A backend can return 403 after proxy authentication succeeds; the status alone does not identify the cause.
- Use the [access logs](/manage/reverse-proxy/access-logs#deny-reasons) and backend logs to identify which component refused the request. A backend can return `401`, `403`, or `404` after proxy authentication succeeds; the status alone does not identify the cause.

## Advanced Debugging with Packet Capture

Expand Down