Collabora not loading editor from ubuntu package

Collabora not loading documents form the nextcloud after i installed form the ubuntu package install.

Ubuntu 18.04
nextcloud 15
Apache2

I am using the server with LXD

Internet
LXC Reverse Proxy
LXC Nextcloud LXC Collabora

I have the apache2 virtualhost file from the collabora installation website showing the installation procedure from package install. I have placed this on the reverse proxy, and I amended ‘127.0.0.1’ local host to the IP of the LXC with collabora installed

<VirtualHost *:443>
  ServerName office.domain.com:443
  Options -Indexes
  Header set Content-Secure-Policy "default-src 'self';"  ### added this myself

  # SSL configuration, you may want to take the easy route instead and use Lets Encrypt!
  SSLEngine on
  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/cloud.domain.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/cloud.domain.com/privkey.pem

  SSLProtocol             all -SSLv2 -SSLv3
  SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
  SSLHonorCipherOrder     on

  # Encoded slashes need to be allowed
  AllowEncodedSlashes NoDecode

  # Container uses a unique non-signed certificate
  SSLProxyEngine On
  SSLProxyVerify None
  SSLProxyCheckPeerCN Off
  SSLProxyCheckPeerName Off

  # keep the host
  ProxyPreserveHost On

  # static html, js, images, etc. served from loolwsd
  # loleaflet is the client part of Collabora Online
  ProxyPass           /loleaflet http://192.168.1.X:9980/loleaflet retry=0
  ProxyPassReverse    /loleaflet http://192.168.1.X:9980/loleaflet

  # WOPI discovery URL
  ProxyPass           /hosting/discovery http://192.168.1.X:9980/hosting/discovery retry=0
  ProxyPassReverse    /hosting/discovery http://192.168.1.X:9980/hosting/discovery

  # Capabilities
  ProxyPass           /hosting/capabilities http://192.168.1.X:9980/hosting/capabilities retry=0
  ProxyPassReverse    /hosting/capabilities http://192.168.1.X:9980/hosting/capabilities

  # Main websocket
  ProxyPassMatch "/lool/(.*)/ws$" ws://192.168.1.X:9980/lool/$1/ws nocanon

  # Admin Console websocket
  ProxyPass   /lool/adminws ws://192.168.1.X:9980/lool/adminws

  # Download as, Fullscreen presentation and Image upload operations
  ProxyPass           /lool http://192.168.1.X:9980/lool
  ProxyPassReverse    /lool http://192.168.1.X:9980/lool
</VirtualHost>

logs are fine from Apache2 no errors

status of systemctl status loolwsd is

● loolwsd.service - LibreOffice Online WebSocket Daemon
   Loaded: loaded (/lib/systemd/system/loolwsd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-05-06 19:48:52 UTC; 21min ago
 Main PID: 201 (loolwsd)
    Tasks: 10 (limit: 4915)
   CGroup: /system.slice/loolwsd.service
           ├─201 /usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice6.0 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd
           ├─277 /usr/bin/loolforkit --losubpath=lo --systemplate=/opt/lool/systemplate --lotemplate=/opt/collaboraoffice6.0 --childroot=/opt/lool/child-roots/ --clientport=9980 --masterport=9981 --rlimits=limit_virt_mem_mb:0;limit_stack_mem_kb:8000;limit_file_size_mb:0;limit_num_open_files:0 --version
           └─330 /usr/bin/loolforkit --losubpath=lo --systemplate=/opt/lool/systemplate --lotemplate=/opt/collaboraoffice6.0 --childroot=/opt/lool/child-roots/ --clientport=9980 --masterport=9981 --rlimits=limit_virt_mem_mb:0;limit_stack_mem_kb:8000;limit_file_size_mb:0;limit_num_open_files:0 --version

May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.763272 [ websrv_poll ] INF  Adding trusted POST_ALLOW host: [::ffff:127\.0\.0\.1].| wsd/LOOLWSD.cpp:1958
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.763520 [ websrv_poll ] INF  Adding trusted POST_ALLOW host: [::1].| wsd/LOOLWSD.cpp:1958
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.846050 [ websrv_poll ] INF  Adding trusted POST_ALLOW host: [192\.168\.[0-9]{1,3}\.[0-9]{1,3}].| wsd/LOOLWSD.cpp:1958
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.846270 [ websrv_poll ] INF  Adding trusted POST_ALLOW host: [::ffff:192\.168\.[0-9]{1,3}\.[0-9]{1,3}].| wsd/LOOLWSD.cpp:1958
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.846421 [ websrv_poll ] INF  Adding trusted POST_ALLOW host: [127\.0\.0\.1].| wsd/LOOLWSD.cpp:1958
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.846573 [ websrv_poll ] INF  Adding trusted POST_ALLOW host: [::ffff:127\.0\.0\.1].| wsd/LOOLWSD.cpp:1958
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.846720 [ websrv_poll ] INF  Adding trusted POST_ALLOW host: [::1].| wsd/LOOLWSD.cpp:1958
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.847767 [ websrv_poll ] INF  Sent cpabilities.json successfully.| wsd/LOOLWSD.cpp:2272
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.848001 [ websrv_poll ] DBG  Removing socket #20 (of 1) from websrv_poll| ./net/Socket.hpp:577
May 06 20:00:10 libreoffice loolwsd[201]: wsd-00201-00334 2019-05-06 20:00:09.848135 [ websrv_poll ] DBG  StreamSocket dtor #20| ./net/Socket.hpp:796

I edited the loolwsd to add my domain in it

<config>

    <!-- Note: 'default' attributes are used to document a setting's default value as well as to use as fallback. -->
    <!-- Note: When adding a new entry, a default must be set in WSD in case the entry is missing upon deployment. -->

    <allowed_languages desc="List of supported languages of Writing Aids (spell checker, grammar checker, thesaurus, hyphenation) on this instance. Allowing too many has negative effect on startup performance." default="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru">de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru</allowed_languages>

    <tile_cache_path desc="Path to a directory where to keep the tile cache." type="path" relative="false" default="/var/cache/loolwsd"></tile_cache_path>
    <sys_template_path desc="Path to a template tree with shared libraries etc to be used as source for chroot jails for child processes." type="path" relative="true" default="systemplate"></sys_template_path>
    <lo_template_path desc="Path to a LibreOffice installation tree to be copied (linked) into the jails for child processes. Should be on the same file system as systemplate." type="path" relative="false" default="/opt/collaboraoffice6.0"></lo_template_path>
    <child_root_path desc="Path to the directory under which the chroot jails for the child processes will be created. Should be on the same file system as systemplate and lotemplate. Must be an empty directory." type="path" relative="true" default="jails"></child_root_path>

    <server_name desc="Hostname:port of the server running loolwsd. If empty, it's derived from the request." type="string" default="">office.DOMAIN.com</server_name>
    <file_server_root_path desc="Path to the directory that should be considered root for the file server. This should be the directory containing loleaflet." type="path" relative="true" default="loleaflet/../"></file_server_root_path>

    <memproportion desc="The maximum percentage of system memory consumed by all of the LibreOffice Online, after which we start cleaning up idle documents" type="double" default="80.0"></memproportion>
    <num_prespawn_children desc="Number of child processes to keep started in advance and waiting for new clients." type="uint" default="1">1</num_prespawn_children>
    <per_document desc="Document-specific settings, including LO Core settings.">
        <max_concurrency desc="The maximum number of threads to use while processing a document." type="uint" default="4">4</max_concurrency>
        <document_signing_url desc="The endpoint URL of signing server, if empty the document signing is disabled" type="string" default="https://app.vereign.com">https://app.vereign.com</document_signing_url>
	<redlining_as_comments desc="If true show red-lines as comments" type="bool" default="true">true</redlining_as_comments>
        <idle_timeout_secs desc="The maximum number of seconds before unloading an idle document. Defaults to 1 hour." type="uint" default="3600">3600</idle_timeout_secs>
        <!-- Idle save and auto save are checked every 30 seconds -->
        <idlesave_duration_secs desc="The number of idle seconds after which document, if modified, should be saved. Defaults to 30 seconds." type="uint" default="30">30</idlesave_duration_secs>
        <autosave_duration_secs desc="The number of seconds after which document, if modified, should be saved. Defaults to 5 minutes." type="uint" default="300">300</autosave_duration_secs>
        <limit_virt_mem_kb desc="The maximum virtual memory allowed to each document process. 0 for unlimited, 1700 min." type="uint">0</limit_virt_mem_kb>
        <limit_data_mem_kb desc="The maximum memory data segment allowed to each document process. 0 for unlimited." type="uint">0</limit_data_mem_kb>
        <limit_stack_mem_kb desc="The maximum stack size allowed to each document process. 0 for unlimited." type="uint">8000</limit_stack_mem_kb>
        <limit_file_size_mb desc="The maximum file size allowed to each document process to write. 0 for unlimited." type="uint">0</limit_file_size_mb>
        <limit_num_open_files desc="The maximum number of files allowed to each document process to open. 0 for unlimited." type="uint">0</limit_num_open_files>
    <limit_load_secs desc="Maximum number of seconds to wait for a document load to succeed. 0 for unlimited." type="uint" default="100">100</limit_load_secs>
    </per_document>

    <per_view desc="View-specific settings.">
        <out_of_focus_timeout_secs desc="The maximum number of seconds before dimming and stopping updates when the browser tab is no longer in focus. Defaults to 60 seconds." type="uint" default="60">60</out_of_focus_timeout_secs>
        <idle_timeout_secs desc="The maximum number of seconds before dimming and stopping updates when the user is no longer active (even if the browser is in focus). Defaults to 15 minutes." type="uint" default="900">900</idle_timeout_secs>
    </per_view>

    <loleaflet_html desc="Allows UI customization by replacing the single endpoint of loleaflet.html" type="string" default="loleaflet.html">loleaflet.html</loleaflet_html>

    <logging>
        <color type="bool">true</color>
        <level type="string" desc="Can be 0-8, or none (turns off logging), fatal, critical, error, warning, notice, information, debug, trace" default="warning">debug</level>
        <file enable="false">
            <property name="path" desc="Log file path.">/etc/loolwsd/loolwsd.log</property>
            <property name="rotation" desc="Log file rotation strategy. See Poco FileChannel.">never</property>
            <property name="archive" desc="Append either timestamp or number to the archived log filename.">timestamp</property>
            <property name="compress" desc="Enable/disable log file compression.">true</property>
            <property name="purgeAge" desc="The maximum age of log files to preserve. See Poco FileChannel.">10 days</property>
            <property name="purgeCount" desc="The maximum number of log archives to preserve. Use 'none' to disable purging. See Poco FileChannel.">10</property>
            <property name="rotateOnOpen" desc="Enable/disable log file rotation on opening.">true</property>
            <property name="flush" desc="Enable/disable flushing after logging each line. May harm performance. Note that without flushing after each line, the log lines from the different processes will not appear in chronological order.">false</property>
        </file>
        <anonymize>
            <filenames type="bool" desc="Enable to anonymize/obfuscate filenames in logs. If default is true, it was forced at compile-time and cannot be disabled." default="false">false</filenames>
            <usernames type="bool" desc="Enable to anonymize/obfuscate usernames in logs. If default is true, it was forced at compile-time and cannot be disabled." default="false">false</usernames>
        </anonymize>
    </logging>

    <loleaflet_logging desc="Logging in the browser console" default="false">false</loleaflet_logging>

    <trace desc="Dump commands and notifications for replay. When 'snapshot' is true, the source file is copied to the path first." enable="false">
        <path desc="Output path to hold trace file and docs. Use '%' for timestamp to avoid overwriting. For example: /some/path/to/looltrace-%.gz" compress="true" snapshot="false"></path>
        <filter>
            <message desc="Regex pattern of messages to exclude"></message>
        </filter>
        <outgoing>
            <record desc="Whether or not to record outgoing messages" default="false">false</record>
        </outgoing>
    </trace>

    <net desc="Network settings">
      <proto type="string" default="all" desc="Protocol to use IPv4, IPv6 or all for both">all</proto>
      <listen type="string" default="any" desc="Listen address that loolwsd binds to. Can be 'any' or 'loopback'.">any</listen>
      <service_root type="path" default="" desc="Prefix all the pages, websockets, etc. with this path."></service_root>
      <post_allow desc="Allow/deny client IP address for POST(REST)." allow="true">
        <host desc="The IPv4 private 192.168 block as plain IPv4 dotted decimal addresses.">192\.168\.[0-9]{1,3}\.[0-9]{1,3}</host>
        <host desc="Ditto, but as IPv4-mapped IPv6 addresses">::ffff:192\.168\.[0-9]{1,3}\.[0-9]{1,3}</host>
        <host desc="The IPv4 loopback (localhost) address.">127\.0\.0\.1</host>
        <host desc="Ditto, but as IPv4-mapped IPv6 address">::ffff:127\.0\.0\.1</host>
        <host desc="The IPv6 loopback (localhost) address.">::1</host>
      </post_allow>
      <frame_ancestors desc="Specify who is allowed to embed the LO Online iframe (loolwsd and WOPI host are always allowed). Separate multiple hosts by space.">cloud.DOMAIN.com MY-EXTERNAL-IP</frame_ancestors>
    </net>

    <ssl desc="SSL settings">
        <enable type="bool" desc="Controls whether SSL encryption is enable (do not disable for production deployment). If default is false, must first be compiled with SSL support to enable." default="true">false</enable>
        <termination desc="Connection via proxy where loolwsd acts as working via https, but actually uses http." type="bool" default="true">true</termination>
        <cert_file_path desc="Path to the cert file" relative="false">/etc/loolwsd/cert.pem</cert_file_path>
        <key_file_path desc="Path to the key file" relative="false">/etc/loolwsd/key.pem</key_file_path>
        <ca_file_path desc="Path to the ca file" relative="false">/etc/loolwsd/ca-chain.cert.pem</ca_file_path>
        <cipher_list desc="List of OpenSSL ciphers to accept" default="ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"></cipher_list>
        <hpkp desc="Enable HTTP Public key pinning" enable="false" report_only="false">
            <max_age desc="HPKP's max-age directive - time in seconds browser should remember the pins" enable="true">1000</max_age>
            <report_uri desc="HPKP's report-uri directive - pin validation failure are reported at this URL" enable="false"></report_uri>
            <pins desc="Base64 encoded SPKI fingerprints of keys to be pinned">
            <pin></pin>
            </pins>
        </hpkp>
    </ssl>

    <security desc="Altering these defaults potentially opens you to significant risk">
      <seccomp desc="Should we use the seccomp system call filtering." type="bool" default="true">true</seccomp>
      <capabilities desc="Should we require capabilities to isolate processes into chroot jails" type="bool" default="true">true</capabilities>
    </security>

    <storage desc="Backend storage">
        <filesystem allow="false" />
        <wopi desc="Allow/deny wopi storage. Mutually exclusive with webdav." allow="true">
            <host desc="Regex pattern of hostname to allow or deny." allow="true">localhost</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="true">10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="true">172\.1[6789]\.[0-9]{1,3}\.[0-9]{1,3}</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="true">172\.2[0-9]\.[0-9]{1,3}\.[0-9]{1,3}</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="true">172\.3[01]\.[0-9]{1,3}\.[0-9]{1,3}</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="true">192\.168\.[0-9]{1,3}\.[0-9]{1,3}</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="false">192\.168\.1\.1</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="true">MY EXTERNAL IP</host>
            <max_file_size desc="Maximum document size in bytes to load. 0 for unlimited." type="uint">0</max_file_size>
        </wopi>
        <webdav desc="Allow/deny webdav storage. Mutually exclusive with wopi." allow="false">
            <host desc="Hostname to allow" allow="false">localhost</host>
        </webdav>
    </storage>

    <tile_cache_persistent desc="Should the tiles persist between two editing sessions of the given document?" type="bool" default="true">true</tile_cache_persistent>

    <admin_console desc="Web admin console settings.">
        <enable desc="Enable the admin console functionality" type="bool" default="true">true</enable>
        <enable_pam desc="Enable admin user authentication with PAM" type="bool" default="false">false</enable_pam>
        <username desc="The username of the admin console. Ignored if PAM is enabled.">XXXX</username>
        <password desc="The password of the admin console. Deprecated on most platforms. Instead, use PAM or loolconfig to set up a secure password.">XXXX</password>
    </admin_console>

    <monitors desc="Addresses of servers we connect to on start for monitoring">
    </monitors>

</config>

I looked at the web browseer error console which brought up a content security policy so I added the line Header set Content-Secure-Policy "default-src 'self';" to the apcahe file. but I am still getting the following errors on the web browser.

Content Security Policy: Ignoring "'unsafe-inline'" within script-src or style-src: nonce-source or hash-source specified
Content Security Policy: Directive ‘child-src’ has been deprecated. Please use directive ‘worker-src’ to control workers, or directive ‘frame-src’ to control frames respectively.
Content Security Policy: The page's settings blocked the loading of a resource at inline ("script-src").
index:1:1
JQMIGRATE: Migrate is installed, version 1.4.0 core.js:7:542
Waiting for page to render… documents.js:583:5
Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help http://xhr.spec.whatwg.org/ bundle.js:22:4770
Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.

All I have is the spinner in an infinate loop on the nextcloud site with a white page, and I have no idea where to look now. Can any advise or point me in the right direction please?

After some digging I found that searching this forum for “howto” leads to some good finds. This one particularly was helpful
link to other help

So to solve my issue I added my nextcloud domain to etc/hosts with the ip of my nextcloud

127.0.0.1 localhost
X.X.X.X cloud.DOMIAN.com

then edited loolwsd.xml with nano /etc/loolwsd/loolwsd.xml
adding server address to the server_name desc line and adding another host desc line with the nextcloud address

<server_name desc="Hostname:port of the server running loolwsd. If empty,
      it's derived from the request." type="string" default="">cloud.DOMAIN.com</server_name>
...

<host desc="Regex pattern of hostname to allow or deny." allow="true">cloud.DOMAIN.com</host>

Go through the guide it is good. Except the person did put <server_name desc="Hostname:port of the server running loolwsd. If empty, it's derived from the request." type="string" default="">cloud.DOMAIN.com:9981</server_name> stating the port number which didn’t work for me and gave 9981 which isn’t being listened on, but I might be missing something.

Hope this helps someone else.