I have installed Nextcloud 15.0.5 on an nginx + php-fpm server (Ubuntu 18.04 versions) and this setup works like a charm.
Now I also set up another nginx server as a reverse proxy to that Nextcloud server. 99% of it works well except for the Files App in the browser: Whenever I open https://my.domain.from.reverse.proxy/apps/files/?dir=/, it eternally shows the progress throbber and doesn’t display any files. Using the Firefox network monitor, I can see that is hangs at the PROPFIND request, which fails with “504 Gateway Timeout”. This is also visible in the nginx error log:
upstream timed out (110: Connection timed out) while reading response header from upstream, client: my.ip, server: my.domain.from.reverse.proxy, request: “PROPFIND /remote.php/dav/files/username/?”
I have already gone miles to fix this problem, but with no success so far.
It is reproducible in any browser, but not using the Nextcloud desktop app or when doing a manual request with curl. Both issue a PROPFIND request, which is successfully answered.
I have also tried all kinds of proxy_ settings in the nginx reverse proxy site configuration and several permutations of trusted* and overwrite* settings in Nextcloud’s config.php. The problem persists.
Who is successfully running Nextcloud in nginx and behind an nginx reverse proxy? What versions and configurations are you using?
Any idea what else I can try out before totally giving up on that setup?