Index.php broken?

Nextcloud version (eg, 18.0.2): 19.0.0.12
Operating system and version (eg, Ubuntu 20.04): FreeBSD 11.3-RELEASE-p9
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.43
PHP version (eg, 7.1): 7.4.7

The issue you are facing:
Some of the pages of my nextcloud installation are broken/not accessible at all, when accessing them via https through the FQDN. Everything seems to be working perfect when accessing the nextcloud locally by pointing the browser at the local ip. The setup is very similiar to the one described by

  1. https://www.samueldowling.com/2020/01/18/nginx-reverse-proxy-freenas-ssl-tls/
  2. https://www.samueldowling.com/2020/06/26/install-nextcloud-on-freenas-iocage-jail-with-hardened-security/

To sum it up, Nextcloud is installed inside a FreeBSD jail and accessible via another jail which serves as reverse proxy with Nginx. Everything used to work well until I failed uploading a 16GB .zip file and started changing things following this part of the documentation: https://docs.nextcloud.com/server/19/admin_manual/configuration_files/big_file_upload_configuration.html
Somewhere along this process something got broken (uploading big files is possible now, by the way).

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Install Nextcloud following the two guides mentioned above
  2. Try to fix the problem with big file uploads

The output of your Nextcloud log in Admin > Logging:

https://pastebin.com/LtgvkQUC

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

https://pastebin.com/ZZnfSQcF

Example of broken main page (no app icons, none of the links/menu items are actually clickable etc.):

Perhaps there was a free storage problem. Because of the undefined error i would reinstall and restore data and db.

I’d love to try and fix (or at least understand) the problem instead of performing a full reinstall, since one of my goals with the entire FreeBSD endeavor is learning how to do stuff correctly there.
Storage issues are unlikely, the install is located on a 5TB zfs pool and so far only 3% are used
As I mentioned, generally, I can use everything and even upload large files when using the local IP. There is some part of the error message which mentions a missing second argument, I’m wondering where to look for that function and what it does/expects… Any help would be greatly appreciated!

This may sound weird, but have you tried using a different browser?

I’m running Nextcloud 19 on FreeBSD 12.1 and PHP7.3, and have had similar issues with certain pages. I used to mainly use Pale Moon, and I noticed that Nextcloud had become flakier and buggier over time. I tried using Vivaldi and (pre-Chromium) Edge, but they also had issues. Different issues, but issues regardless. So I assumed I was stuck with pages that wouldn’t load, or Contacts that I couldn’t select, or the “Apps” app that would sit forever with a spinning circle.

Then I tried Waterfox - success! Everything works again. So far, the only two browsers that seem to work for me with all Nextcloud pages and apps are Waterfox (Classic) and Firefox. It’s possible the upload tweak was just coincidentally before you started having problems.

Alternatively, it’s probably a DNS issue. If everything works perfectly when using an IP but not a domain, then the problem is likely to be with your proxy or DNS. Honestly, you have an unnecessarily complex setup. You don’t need a reverse proxy. You don’t need to use jails. If your goal is to learn how to do stuff correctly, you should start by simply installing Nextcloud. Once things work, then you can add complexity such as jails and proxies.

But you really don’t need jails and proxies. They’re simply not needed for the vast majority of home setups. And the way that guide over-engineers Let’s Encrypt certificates is just bizarre. I know you don’t want to reinstall Nextcloud, but that’s honestly the best way to learn. And ditch those Samuel Dowling guides, they’re unnecessary and he doesn’t seem to do things the robust way. For example, you can get a wildcard certificate and simply use it. You don’t need a reverse proxy in a jail to “manage” certificates for you. Your webserver determines the service by the referrer name, you don’t need a reverse proxy in a jail to “inspect” it for you.

I mean, Samuel Dowling repeating calls them “SSL” certificates and configurations, when the SSL protocol hasn’t been used for years. The last version of the SSL protocol was released in 1996, and it was depreciated completely half a decade ago. His phrasing and framing is not what you need when you’re learning.

All that aside, I think you should try an alternative browser (that’s the easiest thing to try), and then you should re-examine your DNS setup. You didn’t go into much detail about your internal (LAN) DNS setup, and neither do those guides. They instead focus on external DNS and managing dynamic DNS.

Do you run your own local DNS? I use Unbound. Without an internal DNS server managing your different machines, you’ll need to add lines to your “hosts” file on individual machines. Your external DNS service will point to your real-world IP (your router), which will forward the appropriate ports to your FreeBSD machine. This means things will work fine from outside your LAN, but not within it. You need some way for your local machines (laptop, phone) to know which machine is “cloud.example.com”. It’ll only work using an IP address, otherwise.

I hope I’ve given you something to think about, and not pissed you off too much :stuck_out_tongue_winking_eye:

Can you check with the web developer tools if some resources failed to load. Perhaps some URLs haven’t been rewritten properly by putting the real external hostname).

Hi,
I’m not sure which “web developer tools” you refer to, are those somehow integrated into Nextcloud? Or are they a part of my FreeBSD installation?

Edit: I assume you mean my browser’s web developer tools; checking those, it turns out that the feature causing problems was not even nextcloud-related but at a different site. Playing around with cloudflare, I activated Rocket Loader (because, well, speed is nice and all) and that thing was causing problems (can be reproduced). Switching it off now delivers a working nextcloud. Thanks for pointing me in the right direction!

I tried several browsers before, including Firefox, Chrome, Edge, Opera, Vivaldi and Brave, and they all delivered the same broken pages.

Well, I did several working installs of Nextcloud before, e.g. with Ubuntu as OS or as a virtual machine in EsXI 6.5U3. What I liked about this setup (FreeBSD/FreeNAS as server OS, jails and vms to play around with, reverse proxy etc.) is mostly the aspect that I can have a pretty cool NAS server with zfs and a nice GUI and, at the same time, do pretty much of the stuff I could do with virtualization. I plan to add more stuff (like plex, some downloading tools, host websites etc.) on the same hardware and figured that running a reverse proxy would be of advantage, since I could make my different jails accessible through subdomains rather than referrers. I’m pretty new to all of this (simply got lucky and am proud owner of two well-equipped Dell R620 servers) but I enjoy figuring out stuff that may also be of use for my family / small business needs of friends and so on.

I haven’t given my internal DNS much thought for now, but will look into Unbound for sure, thanks. Quick search revealed that it is available for my OpenWRT router, certainly will try to set it up there instead of my main server. However, for now, I’m ok with accessing stuff locally via the IP adresses.

Definitely the first, I’m not the kind of person that gets pissed off very easily :smile: