Regarding the issue of being unable to connect to the Onlyoffice server on NextCloud

1. system conditions
Operating System: CentOS 7
NextCloud: 28.0.3
Onlyoffice: 8.0.1-31
NextCloud uses HTTP for SSL, and OnlyOffice uses Nginx for SSL

2. certificate
NextCloud uses Certbot,
OnlyOffice uses self signature

3. Current situation
NextCloud can be used normally and accessed through SSL. OnlyOffice has been installed and enabled in the app store. OnlyOffice has been deployed according to the official documentation and can also be accessed through SSL. The OnlyOffice interface can be opened normally and document editing can be uploaded.
NextCloud:

Onlyoffice:

4. issue
NextCloud displays

Error while downloading the document file to be converted when entering the connection information for OnlyOffice (Version 8.0.1.31)

By checking the log error of onlyOffice, the following content was found:

[2024-03-11T22:42:48.094] [ERROR] [localhost] [conv_check_814319493_docx] [userId] nodeJS - error downloadFile:url=https://172.168.1.101:5999/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.iVJuPavoLUTl_66tBK0dKg_mdzMcs-D55e-7LvlGmJg;attempt=3;code:null;connect:null Error: Error response: statusCode:404; headers:{“server”:“nginx”,“date”:“Mon, 11 Mar 2024 14:42:48 GMT”,“content-type”:“text/html; charset=utf-8”,“transfer-encoding”:“chunked”,“connection”:“keep-alive”,“vary”:“Accept-Encoding”,“content-security-policy”:“default-src ‘none’”,“x-content-type-options”:“nosniff”,“content-encoding”:“gzip”};
at Request.fResponse (/snapshot/server/Common/sources/utils.js)
at Request.emit (node:events:527:28)
at Request.onRequestResponse (/snapshot/server/Common/node_modules/request/request.js:1066:10)
at ClientRequest.emit (node:events:527:28)
at HTTPParser.parserOnIncomingClient (node:_http_client:631:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
at TLSSocket.socketOnData (node:_http_client:494:22)
at TLSSocket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)

5. My profile
NextCloud:

<?php
$CONFIG = array (
  'instanceid' => 'ocb03arsb182',
  'passwordsalt' => 'VLkldjp1G0D3Sc69213dyEE1CCnh6z',
  'secret' => '8HByL8XopwBtNfVgQ4TtDXo4RU0E8fUho71C7K/EoMDMl5yX',
  'trusted_domains' =>
  array (
    0 => '*',
  ),
  'datadirectory' => '/home/nextclouddata',
  'dbtype' => 'mysql',
  'version' => '28.0.3.2',
  'overwrite.cli.url' => 'https://172.168.1.101',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'nextcloud',
  'installed' => true,
  'default_language' => 'zh_CN',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0.0,
  ),
  'maintenance_window_start' => 1,
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'appstoreenabled' => true,
  'appstoreurl' => 'https://www.orcy.net/ncapps/v2/',
  'cors.allowed-domains' => 'https://172.168.1.101:5999',
  'auth.bruteforce.protection.enabled' => false,
  'app_install_overwrite' =>
  array (
    0 => 'richdocumentscode',
    1 => 'richdocuments',
  ),
);

Onlyoffice:

[root@nextcloud nginx]# cat /etc/onlyoffice/documentserver/local.json 
{
  "services": {
    "CoAuthoring": {
      "sql": {
        "dbHost": "localhost",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "onlyoffice",
        "type": "postgres",
        "dbPort": "5432"
      },
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "Authorization"
        },
        "outbox": {
          "header": "Authorization"
        }
      },
      "requestDefaults": {
        "rejectUnauthorized": false
      },
      "secret": {
        "inbox": {
          "string": "2Q1wFfKBgRVl8AnZWQZrN7nQnZ1qSUps"
        },
        "outbox": {
          "string": "2Q1wFfKBgRVl8AnZWQZrN7nQnZ1qSUps"
        },
        "session": {
          "string": "2Q1wFfKBgRVl8AnZWQZrN7nQnZ1qSUps"
        }
      }
    }
  },
  "queue": {
    "type": "rabbitmq"
  },
  "rabbitmq": {
    "url": "amqp://guest:guest@localhost"
  },
  "storage": {
    "fs": {
      "secretString": "VMwSryFp0SqXaJLRtLPe"
    }
  }
}

Finally, I hope that all experts can help solve this problem. It has been bothering me for over half a month now, thank you all!

Important: You should not post the secret and salt of your config file here…

About you onlyoffice: Where you added the onlyoffice ip the second time you should enter the adress of your nextcloud and in the field above the adress of onlyoffice. Make sure the servers can reach each other!!

Don’t worry, the configuration I sent is in the development environment and the IP address is not authentic. In addition, I have modified the address of the onlyOffice request as per your request, but still reported an error. I have modified two different locations, and the results are the same. Is there any better way?


我将红色位置替换为我的onlyoffice服务器地址,将黄色位置替换为nextcloud服务器地址,现在我的日志报错稍微变了一下,有之前向172.168.1.101:5999/apps/onlyoffice/empty?doc=…变为172.168.1.101:5899/apps/onlyoffice/empty?doc=…。可以发现地址变为像nextcloud服务器下载,我认为修改黄色位置为nextcloud服务器地址的这个做法是对的。

The onlyOffice logs are as follows:

[2024-03-12T09:25:38.802] [ERROR] [localhost] [conv_check_901612610_docx] [userId] nodeJS - error downloadFile:url=https://172.168.1.101:5899/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.iVJuPavoLUTl_66tBK0dKg_mdzMcs-D55e-7LvlGmJg;attempt=3;code:null;connect:null Error: Error response: statusCode:403; headers:{"date":"Tue, 12 Mar 2024 01:25:38 GMT","server":"Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.0.30","strict-transport-security":"max-age=15552000; includeSubDomains","x-powered-by":"PHP/8.0.30","set-cookie":["ocb03arsb182=chi5mnfpvtnegtudfk7i4ead86; path=/; secure; HttpOnly; SameSite=Lax","oc_sessionPassphrase=oSnFbk4CfUXzPhKZ4vpE%2BzCOc59%2FMrzXNCH2J9PbwhdxlzuoQPi2krQfO360LvQqX%2Fd2kjyD5m00PDc11tAtqiDtzqa74mWYKxvlAlwq5xLoznZvAk2klwCS1ZONS6mr; path=/; secure; HttpOnly; SameSite=Lax","ocb03arsb182=chi5mnfpvtnegtudfk7i4ead86; path=/; secure; HttpOnly; SameSite=Lax","__Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax","__Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict","ocb03arsb182=chi5mnfpvtnegtudfk7i4ead86; path=/; secure; HttpOnly; SameSite=Lax"],"expires":"Thu, 19 Nov 1981 08:52:00 GMT","cache-control":"no-cache, no-store, must-revalidate","pragma":"no-cache","content-security-policy":"default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'","referrer-policy":"no-referrer","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-permitted-cross-domain-policies":"none","x-robots-tag":"noindex, nofollow","x-xss-protection":"1; mode=block","x-request-id":"Ze@vErtyBmN720W2gl9piQAAAAE","feature-policy":"autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'","content-length":"38","keep-alive":"timeout=5, max=100","connection":"Keep-Alive","content-type":"application/json; charset=utf-8"};
    at Request.fResponse (/snapshot/server/Common/sources/utils.js)
    at Request.emit (node:events:527:28)
    at Request.onRequestResponse (/snapshot/server/Common/node_modules/request/request.js:1066:10)
    at ClientRequest.emit (node:events:527:28)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:631:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at TLSSocket.socketOnData (node:_http_client:494:22)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)

After I visited the website that appeared in the log, the feedback on the page was as follows:

I searched and it seems to be a cross domain issue, but I can’t solve it. Can someone help me?

So you’re trying to use HTTPS with IPs? This could be the matter. I don’t know if onlyoffice ignores the not matching name of the certificate?

Can you at least give us more information? What way of installation did you choose? Are there docker containers on the same server?

Yes, I don’t have a domain name right now. Currently, I use a self signed certificate for OnlyOffice. I don’t think it’s a problem, as there was no Docker server when installing OnlyOffice. What additional information do you need?

Please check if Onlyoffice can reach Nextcloud and vice versa.

How did you install OnlyOffice?

How to check for onlyOffice access to nextcloud? Are you communicating? My OnlyOffice and NextCloud are both on the same server. I followed the official website installation link: https://helpcenter.onlyoffice.com/installation/docs-community-install-centos.aspx?_ga=2.111501954.782359554.1594636128 -1157782750.1587541027