> ## Documentation Index
> [HTML page](https://blode.md/docs/guides/proxy-nginx)
> [Documentation index](https://blode.md/docs/llms.txt)
> Use the index to discover all available pages before exploring further.

# Proxy /docs through Nginx

Add Nginx location blocks to reverse-proxy /docs and /_docs on your domain to an Edda site while keeping the rest of your site on your server.

Drop this block into your Nginx server config to host docs under
`yourdomain.com/docs`.

## Server block

```nginx
location /docs/ {
  proxy_pass https://acme.blode.md/;
  proxy_set_header Host acme.blode.md;
  proxy_set_header X-Forwarded-Host $host;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_ssl_server_name on;
  proxy_http_version 1.1;
  proxy_buffering on;
}

location = /docs {
  return 301 /docs/;
}

location /_docs/ {
  proxy_pass https://acme.blode.md/_docs/;
  proxy_set_header Host acme.blode.md;
  proxy_ssl_server_name on;
  proxy_http_version 1.1;
}
```

Replace `acme` with your project slug. The trailing slashes matter: they tell
Nginx to strip the `/docs` prefix before forwarding.

The second block is easy to miss and the page renders unstyled without it.
Shared CSS, JavaScript and fonts are served from `/_docs/` at the root of your
domain, not under `/docs`, so they need their own location block: and this one
keeps the prefix instead of stripping it.

## Strip the prefix in Edda

Set the default subdomain path prefix to `/docs` in **Dashboard → Project →
Domains**, or pass `pathPrefix: "/docs"` when creating the domain via the API.

## Declare your public URL

A proxy is invisible to us: the request we receive looks identical to someone
visiting `acme.blode.md` directly, so we cannot tell that your domain sits in
front. Tell us where the site is published:

```json docs.json
{
  "seo": {
    "siteUrl": "https://yourdomain.com/docs"
  }
}
```

Include the path prefix if you use one. Canonical tags, `og:url`, JSON-LD, the
sitemap, `llms.txt` and the `.md` alternates are all built from this value.
Skip it and every page canonicalises to `acme.blode.md` instead of your domain.

## Verifying

```bash
curl -I https://yourdomain.com/docs/
```

You should see a 200 OK and `server: vercel` in the response headers,
indicating the request reached Edda upstream.

If you add `proxy_cache`, include the `Accept` header in `proxy_cache_key` (or
`proxy_no_cache` requests whose `Accept` contains `text/markdown`). Edda
returns Markdown for `Accept: text/markdown` on every page URL, and a cache
keyed on the URL alone would serve the stored HTML to coding agents that send
that header.

```bash
curl -sI -H "Accept: text/markdown" https://yourdomain.com/docs/quickstart | grep -i content-type
```

Expect `text/markdown; charset=utf-8`.

## TLS

Make sure your Nginx server has a valid TLS cert for `yourdomain.com`. The
upstream connection to `*.blode.md` is always HTTPS.