Host XWiki Docker image on certain nginx path


I am currently trying to make an xwiki docker container available under
I configured the nginx to redirecr the path to the docker container’s port. When I now open, the wiki loads (25% …), and then redirects to…, thinking it is a root application. As an approach to fix this, I tried setting xwiki.webapppath=foo in xwiki.cfg, but then the nginx produces a 502 / infinite redirect as described here.

What can I do to make this work?

XWiki is configured as a root app in the docker image so that’s normal.

How do I change this behavior? I was already looking for environment variables that may set a path, but there are none…

Why would you want to change this behavior? IMO you just have a config issue with your nginx server.


I have same problem as pitwegner. I have a Treafik revers proxy serving divers dockerized applications by path prefix (like, and i can’t solve prefixing the Xwiki path.