documentserver_community icon indicating copy to clipboard operation
documentserver_community copied to clipboard

Fails to set https for URLs when behind proxy

Open nsrosenqvist opened this issue 5 years ago • 6 comments

I serve nextcloud (18) via a reverse proxy that handles the SSL certificate handling. It simply passes on all traffic to another server within the same network. At first when I installed documentserver_community it failed to save the ONLYOFFICE settings and displayed a 405 response in the browser. That's when I noticed that the address that had been automatically populated was with http rather than https and I had to change that manually. After that it worked and it was possible to configure ONLYOFFICE.

http

Then however, when I open a document the editor fails to load due to a similar error:

editor

The relevant lines in the console are (excuse the Swedish strings, basically just saying that the resource is blocked due content loaded over http):

Content Security Policy: Sidans inställningar blockerade laddningen av en resurs på inline (“script-src”).
Blockerade laddning av blandat aktivt innehåll “http://[REDACTED]/apps/documentserver_community/open/404012113/Editor.bin”

Let me know if there is anything else I can provide to help debug!

nsrosenqvist avatar Jan 23 '20 17:01 nsrosenqvist

Probably also worth mentioning that X-Forward-Proto is set on the nginx proxy:

proxy_set_header X-Forwarded-Proto $scheme;

nsrosenqvist avatar Jan 23 '20 17:01 nsrosenqvist

same problem here (setup: docker + reverse proxy)

error message in English:

Content Security Policy: The page’s settings blocked the loading of a resource at http://nextcloud.instance/apps/documentserver_community/open/1234567890/Editor.bin (“connect-src”).

pixelyo avatar Jan 24 '20 10:01 pixelyo

You can configure nextcloud to use https for the url's it generated by adding

'overwriteprotocol' => 'https' to your config.php

icewind1991 avatar Jan 24 '20 12:01 icewind1991

@icewind1991 that fixed it! But shouldn't this be detected correctly somewhere in the stack? Do you reckon that this should be considered an issue for nextcloud/server?

nsrosenqvist avatar Jan 24 '20 12:01 nsrosenqvist

I don't get why this happens because in the onlyoffice connector settings I set the document server URL starting with https, not http

JonnyHaystack avatar Apr 07 '20 15:04 JonnyHaystack

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 60 days. Thank you for your contribution!

Retaking repo management include inheritance of old, not treated, and probablty obsolete issues, this is why it was decided to mark issues as stale.

github-actions[bot] avatar Mar 04 '24 00:03 github-actions[bot]

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

github-actions[bot] avatar May 06 '24 00:05 github-actions[bot]