# Add/change URL prefix of server gui

**URL:** https://hub.mender.io/t/add-change-url-prefix-of-server-gui/3706
**Category:** General Discussions
**Created:** [June 2, 2021, 9:44pm UTC](https://hub.mender.io/t/add-change-url-prefix-of-server-gui/3706 "2021-06-02T21:44:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![menderq](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@menderq](https://hub.mender.io/u/menderq)
#### Post date: [June 2, 2021, 9:44pm UTC](https://hub.mender.io/t/add-change-url-prefix-of-server-gui/3706/1 "2021-06-02T21:44:00Z")

</div>

Hi, I would like to change the URL prefix of mender’s server from /ui/ to something like /mender/ui/ so that I can host it behind an nginx reverse proxy.

I can modify the traefik routing in my prod.yml file so that requests make it from the browser to mender-gui, but then it appears all of the links in the gui are hard-coded to /ui/.

It seems this is done in react, and not in a configurable way, here:

> <https://github.com/mendersoftware/gui/blob/2a799ebef96dd9342dc68e2fcfaebdc866f06fdd/src/js/main.js#L19>

Is that correct that there is no ability to add or change the URL prefix for the GUI?

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [June 3, 2021, 12:59pm UTC](https://hub.mender.io/t/add-change-url-prefix-of-server-gui/3706/2 "2021-06-03T12:59:42Z")

</div>

@mzedel can you comment?

---

<div class="post-metadata">

### Author: ![mzedel](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mzedel/32/261_2.png) [@mzedel](https://hub.mender.io/u/mzedel)
#### Post date: [June 4, 2021, 3:40pm UTC](https://hub.mender.io/t/add-change-url-prefix-of-server-gui/3706/3 "2021-06-04T15:40:43Z")

</div>

Yes, that is correct - the basename is kept mostly to keep bookmarks users might have working, without problems, but it should not be a problem to make this configurable. To pass environment variables to the GUI container the `entrypoint.sh` is used and accessed through the loaded `env.js` script/ the `mender_environment` variable (e.g. in the `appReducer.js`).  
So the easiest test might be to add the variable passing to the `entrypoint.sh` and change `main.js` to

```auto
<Router basename={`${mender_environment.basename ? `/${mender_environment.basename}` : '/ui'}/#`}>

```
