Issues with proxy after update

Hi I have issues with my somewhat unusual setup.

I have nextcloud docker installed on Ubuntu 22.04.4 LTS.
I’m using Apache 2.4.52 as a proxy.
I had installed Nexcloud version 24 for some time without problems.
I decided to upgrade it yesterday, so i used instructions from your help:

  • manually increase major version in docker-compose by 1
  • docker compose pull
  • docker compose up -d

but at the end i noticed that web interface broke down, no css.
I checked developer tools and found out that css and js had wrong url.

Now my setup.
My nextcloud is on my LAN, and i do not have public IP, therefore i don’t have domain name.
This means that i’m using mDNS, but mDNS has limitations that it doesn’t support subdomains.
Therefore my nextcloud runs on server.local/nextcloud.

HTML files were correctly requested from this url, but css and js are missing that nextcloud folder now.

config.php:

  GNU nano 6.2                                                                                                        config/config.php                                                                                                                  
<?php
$CONFIG = array (
  'trusted_proxies' => 
  array (
    0 => '127.0.0.1',
  ),
  'overwritehost' => 'server.local',
  'overwriteprotocol' => 'http',
  'overwritewebroot' => '/nextcloud',
  'overwritecondaddr' => '^127\\.0\\.0\\.1$',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => 'ocsa1b0l7w53',
  'htaccess.RewriteBase' => '/',
  'passwordsalt' => 'Cau2Ncfr4mMma60b/qhDqi16FThq6r',
  'secret' => 'zaQfTg+5x+uJY0vLRbM2Vrb3zuzktKwrpM9PiZoOJ+R1jdjs',
  'trusted_domains' => 
  array (
    0 => '192.168.1.137:8081',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '29.0.2.2',
  'overwrite.cli.url' => 'http://192.168.1.137:8081/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'nextcloud',
  'installed' => true,
  'loglevel' => 2,
  'maintenance' => false,
);

apache conf:

<VirtualHost *:80>
        ServerName server.local
        #ServerAlias www.example.com
        ServerAdmin webmaster@example.com
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        ProxyRequests Off
        <Proxy *>
          Order deny,allow
          Allow from all
        </Proxy>

        ProxyPass /munin http://127.0.0.1:8080/munin
        ProxyPassReverse /munin http://127.0.0.1:8080/munin

        ProxyPass /nextcloud http://127.0.0.1:8081
        ProxyPassReverse /nextcloud http://127.0.0.1:8081


        <Location />
          Order allow,deny
          Allow from all
        </Location>

</VirtualHost>

docker-compose.yml:

version: '2'

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - /nextcloud/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=admin
      - MYSQL_PASSWORD=nextcloud
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8081:80
    links:
      - db
    volumes:
      - /nextcloud/nextcloud:/var/www/html
      - /nextcloud/data:/var/www/html/data
    environment:
      - MYSQL_PASSWORD=nextcloud
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db

i don’t really remeber how i installed my nextcloud so if you need any information, feel free to ask for it.

I’m confused because this indicates you only use the IP address to access your Nextcloud instance.

Where is the version tag? Are you certain this is your real Compose file?

This may actually be the source of your problems. You’re double escaping, which likely is not what you want here. The only reason the slashes exists is to escape the periods. This appears to be escaping the slashes themselves.

As it stands you likely don’t need the entire overwritecondaddr line based on your described topology. The condaddr is only used if you want to have the other overwrite parameters applies sometimes but not other times. It sounds like you want them to be active all the time (and that’s most common).

Hi
thanks for your siggestions.

after i posted this question, I also noticed that IP in trusted_domains and changed it to server.local but it didn’t help.

so i removed overwritecondaddr and it now works, i have no idea why it was there in the first place. Thanks again for solution.

if i understand docker sompose correctly, when you do not specify version, you mean latest version.

EDIT: just to clarify, i did both changes ie. trusted_domains and overwritecondaddr

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