Docker XWiki behind reverse proxy

Hi,

I searched the web a lot to solve my problem but with no success till now.

My setup:
I am running XWIKI 10.8.1 in a docker container on a Synology NAS. The port inside the Docker Container is 8080, and outside 8090. The wiki runs via a reverse proxy under a subdomain like wiki.mydomain.de. The protocol used is https which is “transfered” to http on port 8090 on the NAS. the http header forwarding seems to work fine… except for the notifications and sharing functionality.

Notifications are shown but if you click on a link, the URL cannot be resolved… and I already know why. The URL looks like this: https://wiki.mydomain.de:80/bin/view/Main/… for what reason ever, doc.getExternalURL() adds “:80” to the domain. So, I looked for possible solutions an found the xwiki.home and xwiki.url.protocol setting. Changing it to xwiki.home=https://wiki.mydomain.de/ (tried http://wiki.mydomain.de also) and xwiki.url.protocol=https solved the problem in the sharing functionality, but the notifications are now not loaded any longer. The loading circle starts to run, but the list with changes is not displayed.

I tried the WIKI administration also and a lot of combinations of settings, it did not help. Would be great if somebody could give me a hint where or what to search for…

Cheers, Rüdiger

Hello.

Do you see the number of unread notifications anyway?

notif1

Thanks,

Guillaume D

Hi Guillaume,

thx for responding. Yes, the count is there and if I open the RSS-Feed I can see the changes in XML.

Cheers, Rüdiger

OK.

Could you now open the “webDeveloper console” in your browser and type the following code:

require('xwiki-meta').restURL

Example:
Console

Thanks!

Hi,

sure, the response is:

require(‘xwiki-meta’).restURL
“//rest/wikis/xwiki/spaces/Main/pages/WebHome”

Cheers, Rüdiger

As indicated in xwiki.cfg it’s generally better to control that in the wiki descriptor. Makes easier to maintain and works for several wikis.

I think I have a solution for you.

Please import the following XAR in your wiki and try again:
https://jira.xwiki.org/secure/attachment/36085/XWiki.Notifications.Code.Macro.NotificationsMacro.xar

If you confirm it works for you, then you would have contributed to a bug fix :slight_smile: (XWIKI-15784)

Thanks,

Guillaume

Hi,

sorry was offlfine for a while. Your patch unfortunately did not fix it… maybe I did something wrong with the import?
image
I restarted the container after import… but I still see the spinning wheel not disappeering.

Cheers, Rüdiger

Your screenshot shows that you attached the XAR into the wiki but you haven’t installed it. For that you need to click on it and follow the instructions. See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/ImportExport

@evalica Seems we have some UI usability here :wink:

Hi, well I think I imported it. Somehow…
image
I clicked on “import” and the system showed this…
image

But the problem with notification list remains…

Cheers, Rüdiger

Hi Guillaume,
after importing it, I used the console again… it is showing this now…
image
Cheers, Rüdiger

That is very strange.

Could you create a page with the following content (with “wiki” editor, not WYSIWYG) and save it?

{{velocity}}
$request.contextPath
{{/velocity}}

Thanks

Hi I did… the result looks like this…
image

with the source…
image

Cheers, Rüdiger