Raspberry Pi 4 "Could not establish connection to the Collabora Online server" but Nginx seems to be configured correctly

I have Nextcloud installed on a Raspberry Pi 4, via YunoHost, and then I installed the corresponding ARM64 version of the CODE server (richdocumentscode_arm64). When attempting to make CODE run, however, I’m shown the following notice:

Could not establish connection to the Collabora Online server. This might be due to a missing configuration of your web server. For more information, please visit: Connecting Collabora Online Single Click with Nginx

I followed the link, and it asks to edit the Nginx file to have the server correctly point to the CODE path - the problem is, YunoHost is apparently configured to do it already!

  location ~ ^/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) {
    fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
    set $path_info $fastcgi_path_info;
    try_files $fastcgi_script_name =404;
    include fastcgi_params;

    fastcgi_param SCRIPT_FILENAME $request_filename;
    fastcgi_param PATH_INFO $path_info;
    fastcgi_param HTTPS on;
    # Avoid sending the security headers twice
    fastcgi_param modHeadersAvailable true;
    # Enable pretty urls
    fastcgi_param front_controller_active true;
    fastcgi_pass unix:/var/run/php/php7.3-fpm-nextcloud.sock;
    fastcgi_intercept_errors on;
    fastcgi_request_buffering off;
  }

Is there anything else I’m supposed to modify here, or elsewhere? Is the fact that I installed richdocumentscode_arm64 instead of the normal richdocumentscode relevant to this case? (I already attempted to manually change the regex above to add the _arm64 instead, but to no avail)

Hey,
Did you figure anything out regarding this, I have the same problem as you.

IIRC, the problem was solved on the YunoHost-managed version of Nextcloud and yes, the fix was more or less adding the _arm64 on the corresponding Nginx config file.

Sorry, this is probably a stupid question, but where can I find that NGINX config file? I saw here:

it says something about /var/www/nextcloud, but I couldn’t find a config file that looks anything close to what is given there.

Okay, I found it, it was under /etc/nginx/conf.d/yourdomain.d/nextcloud.conf.
I also just had to add _arm64.
Thanks for your help :grin:.

Please help!
Where you put _arm64 to?
/etc/nginx/conf.d/*.conf
or /etc/nginx/nginx.conf

Thank you very much!

If I recall correctly, that line was on the main /etc/nginx/nginx.conf file. If you don’t find it there, try searching for it on the /etc/nginx/conf.d/ folder

Thank you very much, but still showing the link attached below.
LINK

the “could not establish connection” error with collabora on rpi4 is almost always a reverse proxy issue. the tricky part is that collabora uses websockets heavily and a lot of nginx configs dont pass those through properly.

make sure your nginx config has these for the collabora location block:
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection “Upgrade”;

also check that the allowlist in collabora includes your nextcloud domain - if collabora doesnt recognize where the request is coming from it just drops the connection silently.

another common gotcha on rpi4 is that collabora code needs the ARM64 image specifically, the default one is x86 only.

if you want to skip all the nginx/config dance, theres Syncloud ( GitHub - syncloud/platform: Run popular services on your device with one click · GitHub ) which packages nextcloud + collabora together with automatic HTTPS and no reverse proxy needed. i made it for exactly this scenario on raspberry pi. but if you want to stick with your current setup the websocket headers are probably the fix