ONLYOFFICE / onlyoffice-nextcloud

The app which enables the users to edit office documents from Nextcloud using ONLYOFFICE Document Server, allows multiple users to collaborate in real time and to save back those changes to Nextcloud
GNU Affero General Public License v3.0
541 stars 149 forks source link

OnlyOffice Connector only accepts ether DNS or local Ip address only. Can't use one for the other or we'll recieve an 403 Forbidden error #961

Closed DCCInterstellar closed 3 months ago

DCCInterstellar commented 3 months ago

Hello Everyone,

I'm currently using OnlyOffice v9.0.0 on the latest production for Nextcloud (28.0.3) on a Unraid Server. I created two Nextcloud Instances, one for an internal IP address and the other for external use via domain. They are both synchronized with each other, besides the port number and https override in the config of Nextcloud. In the past, I had the ONLYOFFICE Docs address connected to my OnlyOffice domain and was able to edit both via domain and local IP address. However, the recent update or something, If I try to edit any files using a local IP address, while the ONLYOFFICE Docs address is pointing toward my OnlyOffice Domain. I receive an error "403 Forbidden openresty". If I change the ONLYOFFICE Docs address to my local IP address, then the same error occurs on the Nextcloud DNS side but works when I access Nextcloud and OnlyOffice via my local IP address.

I tried separating the HTML, config, and apps folders in Nextcloud to see if I was able to change the ONLYOFFICE Doc address without changing each other. Unfortunately, they both still changed due to the databases that are synced with each other. The only option I could think of is to have both of them completely separate from each other. The downside is, that I have to manage both of them instead of one.

ONLYOFFICE Doc Address as Domain and NextCloud's Domain: Untitled Untitled2

ONLYOFFICE Doc Address as Domain and NextCloud's local IP address Untitled3 Untitled4

SergeyKorneyev commented 3 months ago

Hello, You could try deleting the Docs address and the secret key from the connector's settings in the web interface and adding the following section to config/config.php on each of the instances:

  'onlyoffice' =>
  array (
    'DocumentServerUrl' => 'https://******.***/',
    'jwt_secret' => '***',
  ),

This way you can set the Document Server's address as an IP for one instance and as a domain for the other, so the settings will be pulled from the config file and not the common database.

Alternatively, you could try using the "Advanced server settings" section of the connector's settings to specify the internal addresses of both Docs and Nextcloud.

DCCInterstellar commented 3 months ago

Hello,

You could try deleting the Docs address and the secret key from the connector's settings in the web interface and adding the following section to config/config.php on each of the instances:


  'onlyoffice' =>

  array (

    'DocumentServerUrl' => 'https://******.***/',

    'jwt_secret' => '***',

  ),

This way you can set the Document Server's address as an IP for one instance and as a domain for the other, so the settings will be pulled from the config file and not the common database.

Alternatively, you could try using the "Advanced server settings" section of the connector's settings to specify the internal addresses of both Docs and Nextcloud.

Thank you so much Sergey! I was able to get it working by adding the configuration items you listed inside the config/config.php file on both internal and external instances! I also tried the "Advanced server settings" to specify the internal address of the Docs and Nextcloud but I kept running into the same issue as before. But thank you so much again for helping!