Collabora & Nextcloud 26 On same server

Hi Every one,

I have installed NC 26 running on https://mynextcloud.com and I have setup collabora on same server with apache reverse proxy. When i put https://collaboradomain in my nextcloud office settings its green bullet there seems all fine. but it opens blank document.

Following is the error:

wsd-482327-482352 2023-06-01 18:33:22.257284 +0000 [ websrv_poll ] ERR #25: #25 bad request: [GET /cool/https%3A%2F%2Fmynextcloud.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1252904_ocpue9o%3Faccess_token%3DdK9rXrV9T6cK54yRZdzm7OSfLHrrAsf6%26access_token_ttl%3D1685680382000%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2Fmynextcloud.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1252904_ocpquezrqp9o&compat=/ws HTTP/1.1#015…]: Invalid or unknown request.| wsd/COOLWSD.cpp:3953

my apache reverse proxy VH of apache

please suggest

1 Like

Please take a look and work through the troubleshooting steps

Nextcloud Collabora integration

1 Like

Hi Brother

It is wonderful guide.

I have followed the troubleshooting steps, here are the outcomes

TB Step 1:
from the client, verify access to the Nextcloud UI (use a browser or run curl https://cloud.mydomain/status.php )

TB Step 2:

from the client, verify access to Collabora (use browser or run curl https://office.mydomain/hosting/discovery )

TB Step 3:
from Collabora, verify access to the Nextcloud UI (from console run curl https://cloud.mydomain/status.php )

image

TB Step 4:
from Nextcloud, verify access to Collabora (from console run curl https://office.mydomain/hosting/discovery )

Since Collabora and NC resides on same server so i run both above curl commands on same server.

TB 5:

image

Output:
image

TB 6:
image

Also run above commands

I am unable to make it work

wsd-482327-482352 2023-06-01 18:33:22.257284 +0000 [ websrv_poll ] ERR #25: #25 bad request: [GET /cool/https%3A%2F%2Fmynextcloud.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1252904_ocpue9o%3Faccess_token%3DdK9rXrV9T6cK54yRZdzm7OSfLHrrAsf6%26access_token_ttl%3D1685680382000%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2Fmynextcloud.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1252904_ocpquezrqp9o&compat=/ws HTTP/1.1#015…]: Invalid or unknown request.| wsd/COOLWSD.cpp:3953

same error

the request looks weird… maybe it’s similar root cause as

UPDATE: I see you checked “disable certificate verification” - why did you do this? are you running self-signed certs?

Actually checked with both check or uncheck it does not make any impact.

image

23-06-02 09:46:55.048495 +0000 [ websrv_poll ] ERR #19: #19 bad request: [GET /cool/https%3A%2F%2Fmydomain.com2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F2020150_ocpquezrqp9o%3Faccess_token%3DGknoJ7aYLljUb49OOpv0VMbMUH1TRQjl%26access_token_ttl%3D1685735202000%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2Fmydomain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F2020150_ocpquezrqp9o&compat=/ws HTTP/1.1#015…]: Invalid or unknown request.| wsd/COOLWSD.cpp:3953

We are using letsencrypt SSL.

I tried to understand this, but my setup is not with docker and I don’t have knowledge of docker containers. I am using simple apache Virtual Host for Nextcloud and collabora. I can share virtual host configuration.

another look at your logs makes me think requests send to nextcloud are routed to COOL:

  • wsd/COOLWSDand [ websrv_poll ] - show this request was logged on COOL server
  • /cool/ - should be Collabora prefix
  • /index.php/apps/richdocuments/ - is Nextclouds WOPI URL

– there must be a culprit in your reverse proxy. please double check your config…

1 Like

Bro here is my reverse proxy which exactly same as defined here (I have checked it again over again) nothing mismatched found. Or i am missing something

This is Virtual host for nextcloud

Both resides on same VPS.

1 Like

Further investigating via browser developer mode: Following logs collected

image

It seems like request from nextcloud is going to wss socket. Since we are using SSL Proxy with domain name for collabora i think request should go through ws://collobora/cool or https i think instead wss.

Following commands i run during deployment.
$ sudo coolconfig set ssl.enable false
$ sudo coolconfig set ssl.termination true

How to make NC to send request over ws or https reverse proxy?

there is nothing wrong with ws:// which is web-socket and used for real-time communication (in opposite to request/respose of regular http protocol). I think something is wrong with the reverse proxy which sends request intended to Nextcloud to Collabora.

I’m not very familiar with Apache as reverse proxy… but my guess - there the hostname config is not right… from the post above it looks like you have the config for Colalbora and Nextcloud located in different files… Collabora states

These lines should be inserted into <VirtualHost> definition of the site.

so I would expect both NC and CODE config live in the same VirtualHost

2 Likes

Just want to update.

All above setup is fine. The issue was something with my browser. I have then tested on a another laptop, it is working smoothly. It was my browser that was causing bad/invalid request error.

1 Like