# Running mender server on a path

**URL:** <https://hub.mender.io/t/running-mender-server-on-a-path/4744>\
**Category:** General Discussions\
**Tags:** mender-server\
**Created:** [March 11, 2022, 2:07pm UTC](https://hub.mender.io/t/running-mender-server-on-a-path/4744 "2022-03-11T14:07:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davel](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@davel](https://hub.mender.io/u/davel)\
**Post date:** [March 11, 2022, 2:07pm UTC](https://hub.mender.io/t/running-mender-server-on-a-path/4744/1 "2022-03-11T14:07:11Z")

</div>

Hi all, I’m trying to setup mender server (GUI) to run on an existing host on a subpath. I’m using K8S on Azure and I’m using the helm chart [mender-helm/mender at master · mendersoftware/mender-helm · GitHub](https://github.com/mendersoftware/mender-helm/tree/master/mender)

I’ve set global.url in values to the full URL with subpath i.e. [https://app.example.com/mender](https://app.example.com/mender) and the serving of the html page works but all of the assets in the html are without the path i.e. [https://app.example.com/env.js](https://app.example.com/env.js)

Are there any settings I can use to control this?

---

<div class="post-metadata">

**Author:** ![alfrunes](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/alfrunes/32/703_2.png) [@alfrunes](https://hub.mender.io/u/alfrunes)\
**Post date:** [March 15, 2022, 5:57pm UTC](https://hub.mender.io/t/running-mender-server-on-a-path/4744/2 "2022-03-15T17:57:02Z")

</div>

Hey!  
Unfortunately the `global.url` does not allow configuring custom sub-paths and can only point to the host URL. It should be pretty straight forward to modify the chart to make the gateway (Traefik) aware of it. I created a [tentative PR](https://github.com/mendersoftware/mender-helm/pull/78) to the Helm repository.

---

<div class="post-metadata">

**Author:** ![alfrunes](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/alfrunes/32/703_2.png) [@alfrunes](https://hub.mender.io/u/alfrunes)\
**Post date:** [March 16, 2022, 12:30pm UTC](https://hub.mender.io/t/running-mender-server-on-a-path/4744/3 "2022-03-16T12:30:23Z")

</div>

Alternatively, it’s probably easier to configure the ingress to rewrite the target URL. For example, if you’re using `nginx` ingress controller you can do:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: mender-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$0
spec:
  rules:
  - host: "app.example.com"
    http:
      paths:
      - path: /mender($|/)(.*)
        pathType: Prefix
        backend:
          service:
            name: mender-api-gateway
            port:
              number: 80

```

---

<div class="post-metadata">

**Author:** ![davel](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@davel](https://hub.mender.io/u/davel)\
**Post date:** [April 4, 2022, 10:45pm UTC](https://hub.mender.io/t/running-mender-server-on-a-path/4744/4 "2022-04-04T22:45:40Z")

</div>

Hi @alfrunes, I went with a dedicated hostname and cert. Originally I wanted all publicly accessible stuff to be behind 1 hostname but I think it may be more trouble than it’s worth. I may reattempt and will report back.
