Connecting Collabora Online built-in CODE Server with Nginx

When you are using a Nginx server, you need to do a small modification to your existing configuration. For the Collabora Online app to work, you have to add a ‘richdocumentscode/proxy’ entry point as an allowed location to the config in the webroot of your nginx installation. From the documentation at Nextcloud:

location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) {

If you experience any problems, of have any questions, pls do contact us.

14 thoughts on “Connecting Collabora Online built-in CODE Server with Nginx

  1. I have changed the line in the config file from:

    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {

    to

    location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) {

    Rebooted the server then re-enabled the built-in CODE in settings where it then says ‘ Collabora Online server is reachable.’ But I am unable to open any documents. It just throws up the error Collabora could not be reached, try again later

  2. Hi Luke San
    We are sorry about this; but trying to improve the experience there.
    Usually the non-working Built-in CODE server is down to one of these:
    * not installed fontconfig
    * missing FUSE support
    What is the server you are running? Can you try to install fontconfig
    & fuse, and restart nginx?
    Since you are running nginx, it would be also good to restart php-fpm.

    Please let us know if it helped! The thread where this is being
    discussed is here:

    https://github.com/CollaboraOnline/richdocumentscode/issues/26

    1. Thank you for the quick reply,
      I have checked and both fontconfig and fuse are installed.
      Im running on Ubuntu 18.04 Server following the C Reiger install over a year ago.

      CODE server says its connected but just unable to load when i try

      1. C. Rieger recently updated his guide: https://www.c-rieger.de/nextcloud-installationsanleitung/
        so you will need do insert:

        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;
        include php_optimization.conf;
        }

        into your /ets/nginx/conf.d/nextcloud.conf

    2. In my case help this:
      location ~ ^(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) {

  3. I’m a bit confused about which file to change here.. Could you please point me in the right direction? I’m running Unraid 6.8.3 with Nextcloud 19 in a docker container (linuxserver/nextcloud package). NginxProxyManager (again Docker) is on reverse proxy duties and MariaDB (as a Docker container as well) is the database backend.
    So which config file should I look at and where to find it?

    All the best

    1. Hi Azat,
      Sorry for the late handling of your comment..!
      If _if_ the problem still exists, pls send a mail with as much as info as possible to hello @
      Thanks & again my appoligies,

      Cor

  4. In case you use the ARM64 CODE at System like Raspi, you need to use the following line for nginx:
    location ~ ^\/(?:index|apc|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy|.+\/richdocumentscode_arm64\/proxy|)\.php(?:$|\/) {

    The original works only with the x86 CODE as it seems, just to save you some time in the future.

  5. I am using a shared web-hoster service and have no access to /ets/nginx/conf.d
    How can I make the Collabora CODE Server work?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.