Caddy shows no styles and pictures when proxying nextcloud in docker

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.

I am now running nextcloud in docker.

The Caddyfile is:

domain.url.me
{
gzip
proxy /nextcloud 172.17.0.4:80 {
without nextcloud
}
}

It works,BUT the web shows only text,with no styles and pictures.

How can I fix it?

Hi @Azathoth_Nie, welcome to the Caddy community.

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:

  1. Serve Nextcloud from the web root instead.
    (A subdomain works much better than a subfolder and will solve all the issues you’re seeing)
  2. 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)
  3. 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)

Thanks!It works now!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.