CORS issues

Issues during installation and related to database
Post Reply
qo3SA6h8
Posts: 2
Joined: Mon Aug 03, 2020 10:02 pm

CORS issues

Post by qo3SA6h8 » Mon Aug 03, 2020 10:27 pm

I spent some time this weekend evaluating self hosted office solutions, Only Office is the more complete solution for my needs but I'm struggling to make it work in my self-hosted environment, as a last resort I wanted to reach out and see if someone can point me at what I'm missing. It seems simple enough but I've been unable to resolve this.

I'm trying to integrate:
only office document server, latest pull ,https://onlyoffice.mydomain.org, 192.168.90.47/24.
seafile professional edition, v7.1.5, https://seafile.mydomain.org, 192.68.90.40/24.
these two services sit behind traefik 2.2.8 with a minimal config, the core parts being

Code: Select all

    seafile:
      rule: "HostHeader(`seafile.mydomain.org`)"
      entryPoints:
        - "web-secure"
      service: seafile
      tls:
        domains:
          - main: "mydomain.org"
            sans: ["*.mydomain.org"]

    onlyoffice:
      rule: "HostHeader(`onlyoffice.mydomain.org`)"
      entryPoints: ["web-secure"]
      service: onlyoffice
      tls:
        domains:
          - main: "mydomain.org"
            sans: ["*.mydomain.org"]
Seafile functions as expected other than only office integration Im struggling with.
only office shows 'Document Server is running' when accessed at https://onlyoffice.mydomain.com

I can create new files in seafiles user interface and see 200 responses, when attempting to open the files I see and 'Unknown error' in the GUI, and the following errors. I'm not sure where i should be adding headers to disable the CORS policy and allow seafile.mydomain.org, or if theres an option in either program to configure.

From seafile I can hit the api.js point fine,

Code: Select all

curl https://onlyoffice.base8.org/web-apps/apps/api/documents/api.js
/*
 * Copyright (c) Ascensio System SIA 2020. All rights reserved
 *
 * http://www.onlyoffice.com
 *
 * Version: 5.6.0 (build:17)
 */


;(function(DocsAPI, window, document, undefined) {
snip....
any tips greatly appreciated, thank you in advance
Attachments
sprderr.jpg
sprderr.jpg (169.97 KiB) Viewed 350 times
preserr.png
preserr.png (143.52 KiB) Viewed 350 times
docerr.jpg
docerr.jpg (166.81 KiB) Viewed 350 times

qo3SA6h8
Posts: 2
Joined: Mon Aug 03, 2020 10:02 pm

Re: CORS issues

Post by qo3SA6h8 » Sun Aug 09, 2020 1:50 am

This thread helped with the solution https://github.com/ONLYOFFICE/onlyoffic ... issues/151

Added middleware additions to my Traefik 2.0 onlyoffice and things started to work

Code: Select all

        customRequestHeaders:
          "X-Forwarded-Proto": "https"
Hope this helps some other folks.

Carl
Posts: 479
Joined: Thu Apr 12, 2018 10:00 am

Re: CORS issues

Post by Carl » Thu Aug 13, 2020 7:58 am

Hello qo3SA6h8,

Please try adding the CORS header to /etc/onlyoffice/documentserver/nginx/ds.conf inside the Document Server container:

Code: Select all

add_header Access-Control-Allow-Origin *;
After that run service nginx reload and check if the issue persists.

Post Reply