Nextcloud Files App doesn't work behind nginx reverse proxy

webdav
nginx
nc15
#1

Hello!
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?

#2

Just a grasp of idea - isn’t your web server limited to GET, POST, HEAD requests only?
EDIT: never mind, just followed again, your curl is success…

#3

I’m setting up a new Nextcloud install using docker with a nginx lets encrypt docker sat as the web facing server with reverse proxy set up to nextcloud.

I see the same behaviour as you describe op, spinning icon, never loads file list. Did you manage to fix this issue?

#4

I have also very very similar issue, but I’m using reverse proxy with apache2 and nextcloud is installed inside of proxy server.
For more detail:
My network structure is [gateway; WAN 12.34.56.78, lan 192.168.0.1] <-- 80 port forward --> [proxy debian; 192.168.0.2 -> wordpress:50080, nextcloud:60080] -> [other services outside of proxy].
So, I didn’t see infinite loading circle INSIDE of 192.168.0.0 network like 192.168.0.100, for both 12.34.56.78 and 192.168.0.2 access addresses with 80 port. But OUTSIDE of 192.168.0.0 network, that loading screen appear.
There is also no log on nextcloud. What should I do?

#5

The problem was gone after applying https. :grimacing: