> For the complete documentation index, see [llms.txt](https://mercure-technologies.gitbook.io/xprem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mercure-technologies.gitbook.io/xprem/3-1-0/deployment/serve-under-a-path-prefix.md).

# Serve under a path prefix

Run the server at a path such as https\://org.com/ota.

Use a path prefix when several services share one domain.

```bash
BASE_URL=https://org.com/ota
```

The server uses this prefix in update URLs, dashboard URLs, and redirects.

Choose one configuration:

1. Your proxy removes `/ota` before forwarding requests.
2. Your proxy forwards `/ota` unchanged.

### Proxy removes the prefix

This is the default. Do not set `SERVE_FROM_SUB_PATH`.

The server receives paths without `/ota`, such as `/manifest` and `/dashboard`.

```nginx
location /ota/ {
    proxy_pass http://xprem:3000/;
    proxy_set_header Host $host;
}
```

The trailing slash after `:3000/` removes `/ota` before forwarding.

### Proxy keeps the prefix

Set `SERVE_FROM_SUB_PATH=true` when your proxy cannot rewrite paths.

```bash
BASE_URL=https://org.com/ota
SERVE_FROM_SUB_PATH=true
```

The server receives paths with `/ota`, such as `/ota/manifest`.

```nginx
location /ota/ {
    proxy_pass http://xprem:3000;
    proxy_set_header Host $host;
}
```

Health and metrics endpoints stay at the server root:

* `/hc`
* `/ready`
* `/metrics`, when enabled

### Configure your app

Use the prefixed manifest URL:

```json
{
  "updates": {
    "url": "https://org.com/ota/manifest"
  }
}
```

`eoas init` and `--serverUrl` also accept a URL with a path prefix.

### MCP server

{% hint style="info" %}
If you use the [MCP server](/xprem/3-1-0/ai/mcp-server.md), forward its discovery URLs too:

* `/.well-known/oauth-authorization-server/ota`
* `/.well-known/oauth-protected-resource/ota`
* `/.well-known/oauth-protected-resource/ota/mcp`
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://mercure-technologies.gitbook.io/xprem/3-1-0/deployment/serve-under-a-path-prefix.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
