# When deploying in a subpath, the ui/agent interface returns script paths without the subpath prefix, and setting the MOUNT\_PREFIX environment variable has no effect. How to solve this?

**URL:** https://forum.langchain.com/t/when-deploying-in-a-subpath-the-ui-agent-interface-returns-script-paths-without-the-subpath-prefix-and-setting-the-mount-prefix-environment-variable-has-no-effect-how-to-solve-this/258
**Category:** Deployment
**Tags:** self-hosted
**Created:** [July 4, 2025, 8:57pm UTC](https://forum.langchain.com/t/when-deploying-in-a-subpath-the-ui-agent-interface-returns-script-paths-without-the-subpath-prefix-and-setting-the-mount-prefix-environment-variable-has-no-effect-how-to-solve-this/258 "2025-07-04T20:57:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Juicpt](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@Juicpt](https://forum.langchain.com/u/Juicpt)
#### Post date: [July 4, 2025, 8:57pm UTC](https://forum.langchain.com/t/when-deploying-in-a-subpath-the-ui-agent-interface-returns-script-paths-without-the-subpath-prefix-and-setting-the-mount-prefix-environment-variable-has-no-effect-how-to-solve-this/258/1 "2025-07-04T20:57:05Z")

</div>

Hello everyone,

I’ve encountered an issue when deploying a application under a subpath. Specifically, when the application is deployed behind a reverse proxy (like Nginx) under a subpath such as `/subpath/`, the paths for static assets (like JavaScript scripts and CSS stylesheets) referenced in the HTML page returned by the `ui/agent` interface do not correctly include the subpath prefix.

For example, I expect the script path to be `/subpath/ui/agent/entrypoint.js`, but the actual path returned in the interface is `/ui/agent/entrypoint.js`. This causes the browser to fail to load these resources, resulting in a blank page or a non-functional application.

I have already tried setting the `MOUNT_PREFIX=/subpath` environment variable, but it doesn’t seem to have any effect, and the problem persists.

**Core Issue:**

- **Symptom:** When the `ui/agent` application is deployed in a subpath, the URLs for its static resources (JS/CSS) are incorrect because they are missing the subpath prefix.
- **Attempted Solution:** Setting the `MOUNT_PREFIX` environment variable did not solve the problem.

It appears that the `ui/agent` interface is not reading or using the `MOUNT_PREFIX` environment variable.
