How can I setup a subpath for Portainer ?

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 !

Searching on Portainer GitHub would have returned some useful hints

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

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 !

good it is working for your now.