XWiki behind nginx

I use the latest docker image with a nginx-Proxy and tried to move the wiki to the subfolnder “wiki”. I set the xwiki.webapp to “wiki” and restartet the wiki instance.

Now the following problem occurs; Some of the links are ok, some of the links get a 404.

For example that works:
https://www.domain.tld/wiki/bin/download/FlamingoThemes/Iceberg/logo.svg?rev=1.1
https://www.domain.tld/wiki/bin/jsx/XWiki/SharePage?language=en&docVersion=1.1

For example not works:
https://www.domain.tld/wiki/webjars/wiki%3Axwiki/drawer/2.4.0/css/drawer.min.css
https://www.domain.tld/wiki/resources/js/prototype/prototype.min.js?cache-version=1620757204000

It seems all things under “resources” and “webjars” are not moved to this subfolder.

Is this intended? Or is there a workaround that I could do?

Thanks in advance.

Solution for nginx:

location ~* /(rest|asyncrenderer)/ {
	include /config/nginx/proxy.conf;
	set $upstream_app xwiki;
	set $upstream_port 8080;
	set $upstream_proto http;
	proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}

location ~* /wiki/(webjars|resources) {
	include /config/nginx/proxy.conf;
	set $upstream_app xwiki;
	set $upstream_port 8080;
	set $upstream_proto http;
	proxy_pass $upstream_proto://$upstream_app:$upstream_port;

	rewrite /wiki(.*) $1 break;
}

location /wiki/ {
	include /config/nginx/proxy.conf;
	set $upstream_app xwiki;
	set $upstream_port 8080;
	set $upstream_proto http;
	proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
1 Like