richdocumentscode icon indicating copy to clipboard operation
richdocumentscode copied to clipboard

Blank page with Collabora in Nextcloud behind Apache proxy - Mixed content error

Open hexitnz opened this issue 5 years ago • 17 comments

I have SNAP NC 19.0.3 installed with Collabora built in code server 4.2.8 and Collabora online 3.7.4. In NC settings it shows a tick and Collabora online server as reachable. If I configure and access NC as http://192.168.1.? it works ok and so does Collabora. However if I configure and access via an Apache Proxy on 192.168.1.12 (https>http) ie, https:// nextcloud.my.domain, NC works fine but opening a document gives me a white page. Noted that in NC settings it shows a tick and Collabora online server is still reachable.

Selecting the demo server works OK. Switching back to built in code server is the same fault again.

I have been doing some searching but can't find a solution. I am guessing it is either an https>http issue or the proxy but so far I am stumped. BTW, using Onlyoffice & Community Document Server works OK.

PS On inspecting the Firefox console output it is showing mixed content errors: Content Security Policy: The page's settings blocked the loading of a resource at http://nc.my.domian/extra-apps/richdocumentscode/proxy.php?status ("connect-src").

So how do I get the Collabora code server to work via https>http apache proxy or is it not possible with Nextcloud Snap?

hexitnz avatar Oct 13 '20 01:10 hexitnz

Having spent some time on this issue I have come to the conclusion that Collabora internal code server is not a working option with Snap HTTP NextCloud behind an Apache Proxy server that terminates HTTPS given the mixed content error and the inability to edit Snap config files.

A pity but the best working option for now is to use OnlyOffice or a manual non Snap NC install and then go onto work out how to fix the mixed content error.

hexitnz avatar Oct 14 '20 19:10 hexitnz

The proxy was a red hearing. A fresh standard non snap install of NC 20 with richdocument installed gives a working Collabora. Then adding a self signed SSL to Apache and adjusting the NC config for SSL gives a mixed content error when loading a doc and Collabora.

Is there anyway to get richdocument to reply using HTTPS as setup on NC rather than ignoring and using http?

hexitnz avatar Oct 17 '20 20:10 hexitnz

I'm seeing this issue too. Did you ever find a solution that didn't involve using onlyoffice instead? If you did I'd be interested in knowing the solution.

keithjnewman avatar Mar 12 '21 13:03 keithjnewman

Hello, I am experiencing the same mixed content issue. Content Security Policy: The page’s settings blocked the loading of a resource at http://cloud/apps/richdocumentscode/proxy.php?status (“connect-src”). Blocked loading mixed active content “http://cloud/apps/richdocumentscode/proxy.php?req=/loleaflet/8979e63/loleaflet.html?WOPISrc=https%3A%2F%2Fcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F24396_oc3wcorj7xgw&title=test.ods&lang=en&closebutton=1&revisionhistory=1” If I attempt to reach these URLs over https there is a response and Collabora does attempt to load but there are simply more mixed content failures. I have been unable to find any setting or config file where I can correct this. If you choose to use the internal server (which I want because this is a setup for light use) It understandably does not give you any other configuration options. It should have all the info it needs. And it almost works where it not for a small oversight. I did set overwrite protocol in the nextcould settings but that does not have any effect on it ether. Also updated to NextCloud 21.0.1 but that made no difference. I have Collabora Online 4.0.4 installed with Collabora Online - Built-in CODE Server 6.4.705

RedSackles avatar Apr 14 '21 08:04 RedSackles

Same here. I have a reverse-proxy in front of Nextcloud, that does the https encryption, and Nextcloud is on another machine (exposed with http). This setup works fine for all other Nextcloud apps.

When trying to open a document handled by Collabora, the browser tries to directly access the nextcloud server (with http) which is blocked (because of mixed content)

Nextcloud 21.0.2 with Collabora Online 4.1.1 and built-in CODE 6.4.806 (arm64 version)

mossroy avatar Jun 03 '21 15:06 mossroy

Is there a solution to using Collabora with Nextcloud behind a reverse proxy yet?

caretakerscurse avatar Oct 21 '21 22:10 caretakerscurse

I am experiencing the same issue. Just setup Nextcloud and Collabora in two docker instances. Nginx is running as https reverse proxy on a separate machine. No matter the configuration, I cannot get around the mixed content error message when trying to view a document in Nextcloud.

kennyboy55 avatar Feb 21 '22 16:02 kennyboy55

yeah this is a issue without support for nextclouds overwriteprotocol it is basically impossible to use this over a reverse proxy with https. I struggled with it for a few days now

kjboa avatar Mar 24 '22 12:03 kjboa

Finally I found a solution here

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

greenbourne277 avatar May 19 '22 17:05 greenbourne277

Finally I found a solution here

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

Already have this in my config, so I'm still broken.

caretakerscurse avatar May 27 '22 06:05 caretakerscurse

Already have this in my config, so I'm still broken.

With 'overwriteprotocol' => 'https' configured, try changing the server setting to "Use your own server" and check the box for "Disable certificate verification"

image

After hitting save, it defaults back to selecting the built-in CODE option (I think it detected the same server name), but after checking the box it worked for me with no error.

image

lawndoc avatar Aug 15 '22 07:08 lawndoc

I have the same problem. I use Nginx as reverse proxy which does the HTTPS-termination and forwards traffic to Nextcloud using plain HTTP. None of the options in this thread worked for me. Also, Nextcloud is not running on the root path of my server but on a subpath called "nextcloud". I access my Nextcloud using https://my-server.tld/nextcloud, which works fine for everything except Collabora-Online.

My CPS message looks like this:

Content Security Policy: The page’s settings blocked the loading of a resource at http://my-server.tld/custom_apps/richdocumentscode/proxy.php?req=/browser/358ba77/cool.html?WOPISrc=https%3A%2F%2Fmy-server.tld%2Fnextcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F...

It looks like not only the scheme is wrong (http instead of https) but also it is missing the correct root path, which is configured in config.php using 'overwritewebroot' => '/nextcloud'

ghost avatar Aug 25 '22 18:08 ghost

This is still an issue in Nextcloud version 25.0.2. Has anyone found a solution yet?

ghost avatar Jan 06 '23 10:01 ghost

I'm still on the latest 24 version and it stopped working for me. I receive now the following error message: Content Security Policy: The page’s settings blocked the loading of a resource at data: (“media-src”).

greenbourne277 avatar Feb 24 '23 18:02 greenbourne277

In my case, this solved the issue

Megver83 avatar May 21 '23 03:05 Megver83

@Megver83 Thanks a lot for posting this! That worked for me :)

greenbourne277 avatar May 22 '23 11:05 greenbourne277

hello, same problem for me to

pwepwe973 avatar Jul 20 '23 18:07 pwepwe973