Nextcloud version---------------------Docker pull nextcloud
Operating system and version-----Debian GNU/Linux 9 (stretch)
Web server------------------------------Caddy in docker
Docker version-------------------------18.06.0-ce
I am trying to use nextcloud in docker,with a Caddy in docker as the web server.
This is a pretty well-known issue with almost all apps, and it occurs because the app (Nextcloud) thinks it should refer your browser to static assets it stores in the web root - but you actually have it in a subfolder (/nextcloud).
Your possible fixes - roughly ordered from least difficult to most difficult - are:
Serve Nextcloud from the web root instead.
(A subdomain works much better than a subfolder and will solve all the issues you’re seeing)
Configure the server at 172.17.0.4:80 to serve Nextcloud out of a subfolder, then remove without /nextcloud from your Caddyfile.
(If the web server at that IP address is nginx with the official configuration, this should be simple enough)
Use http.filter to process the HTTP coming back from the proxy, replacing instances of URLs with the corrected URI.
(This one’s gonna involve a bunch of trial and error, probably, and any redirects will still be broken until #2144 is merged and you can configure header rewriting)