Join the community today
Register Now

Updating NextCloud

Discussion in 'Other Web Apps usage' started by iaTa, Apr 14, 2019.

  1. iaTa

    iaTa Member

    62
    10
    8
    Mar 26, 2018
    Ratings:
    +16
    Local Time:
    10:09 PM
    I have NextCloud up and running on CM.

    When NextCloud release an update and I update the server I see a load of JS errors which break the site until I recompile NGINX:
    Code:
    Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-f8vbju5oPOexH4fvdsvqcc2XedZJbp/YMC7gBZoyy/Qwbw='), or a nonce ('nonce-...') is required to enable inline execution.
    Why would recompiling NGINX fix these errors - does it clear a javascript cache?

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,873
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    8:09 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Recompiling nginx woudn't have anything to do with it. Tried just restarting nginx and php-fpm services after updating Nextcloud ? Recompile nginx also has a nginx service restart which maybe it.
    Code (Text):
    nprestart

    Are you behind Cloudflare ? Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce- · Issue #4754 · nextcloud/server

    Or using ngx_pagespeed Nextcloud 12 doesn't work with chrome · Issue #5345 · nextcloud/server ? may need to use nginx pagespeed disable filters for some of your nextcloud static files / js etc

    You'd have to troubleshoot and tweak it yourself following these guides and info outlined below
     
  3. iaTa

    iaTa Member

    62
    10
    8
    Mar 26, 2018
    Ratings:
    +16
    Local Time:
    10:09 PM
    Nope not behind CloudFlare and tried restarting nginx after an upgrade.

    Pagespeed is enabled on the server but it has not been enabled on the NextCloud site.

    Only thing that fixes it is to recompile nginx. Tested this multiple times. So weird.
     
    Last edited: Apr 14, 2019
  4. eva2000

    eva2000 Administrator Staff Member

    54,873
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    8:09 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    I'd still follow troubleshooting steps outline above for pagespeed as enabling pagespeed history/message log can reveal what if anything pagespeed is doing server wide.
     
  5. iaTa

    iaTa Member

    62
    10
    8
    Mar 26, 2018
    Ratings:
    +16
    Local Time:
    10:09 PM
    Checked the html and pagespeed was being used even though the pagespeed.conf files were commented out in the main config. Added 'pagespeed off' and all is sorted.

    Thanks for the pointer!
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,873
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    8:09 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yup commenting out in vhost isn't enough if other vhosts have pagespeed include files enabled. Latest pagespeed uses pagespeed unplugged instead of pagespeed off to disable it though pagespeed off i think is deprecating eventually.