# How can I setup a subpath for Portainer?

**URL:** <https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116>\
**Category:** General Discussion\
**Created:** [27 December 2021 09:38 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116 "2021-12-27T09:38:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)\
**Post date:** [27 December 2021 09:38 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116/1 "2021-12-27T09:38:32Z")

</div>

Hi,

I installed Portainer from dietpi-software, and it works great for managing my containers. Now I would like to put it behind my Nginx reverse proxy like all my other services (Jellyfin, Ombi…) so it can be under my SSL cert too. But for that I need to setup a subpath for Portainer (/portainer) like for all my other services. But I didn’t find any setting for this in Portainer.

I searched a lot what setting I could set to the Portainer container (because Portainer itself is a container in the Docker install) to setup this subpath or subfolder, but I didn’t find any info on it.

Does someone have an info on it ?

Thanks in advance for any answer,  
Have a great day !

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [27 December 2021 10:30 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116/2 "2021-12-27T10:30:44Z")

</div>

Searching on Portainer GitHub would have returned some useful hints

[https://github.com/portainer/portainer/issues/418#issuecomment-284555478](https://github.com/portainer/portainer/issues/418#issuecomment-284555478)

---

<div class="post-metadata">

**Author:** ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)\
**Post date:** [27 December 2021 11:03 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116/3 "2021-12-27T11:03:19Z")

</div>

> [@](#):
>
> Searching on Portainer GitHub would have returned some useful hints
> 
> [API endpoint broken for reverse proxy · Issue #418 · portainer/portainer · GitHub](https://github.com/portainer/portainer/issues/418#issuecomment-284555478)

Yes, I found this too and this is the Nginx config I already use. But I’m looking for the Portainer config. The problem is that I would like Portainer to be hosted on a subpath, not on the root of my domain. So it requires Portainer to add a /portainer to all its pages, and I didn’t find how to do this.

EDIT : I’m stupid, a few posts before there was the argument “path\_beg” that appears to be a solution. I’ll try that asap and tell you how it goes, thanks

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [27 December 2021 11:20 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116/4 "2021-12-27T11:20:08Z")

</div>

I simply copied the Nginx config lines into my test web server configuration and Portainer was reachable by subpath ootb. Nothing to be changed on Portainer side.

![picture.png](https://dietpi.com/forum/uploads/default/original/2X/e/e3fda79eb77e42255e0a08c49159ce564871fd2a.png)

---

<div class="post-metadata">

**Author:** ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)\
**Post date:** [27 December 2021 22:42 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116/5 "2021-12-27T22:42:10Z")

</div>

> [@](#):
>
> I simply copied the Nginx config lines into my test web server configuration and Portainer was reachable by subpath ootb. Nothing to be changed on Portainer side.  
>   
>   
> picture.png

I don’t understand why, but I tried again and this time it worked. I probably did something wrong all the other times without noticing. That’s probably the stupidest question I’ve asked on this forum, very sorry for making you loose time on this very simple thing. Everything works correctly, thanks again !

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [28 December 2021 08:30 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116/6 "2021-12-28T08:30:50Z")

</div>

good it is working for your now.

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [27 January 2024 09:16 UTC](https://dietpi.com/forum/t/how-can-i-setup-a-subpath-for-portainer/6116/7 "2024-01-27T09:16:09Z")

</div>

Closed on 27 January 2024 09:16 UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
