Domain change still redirects to old domain

Nextcloud version : 20.0.4-fpm-alpine
Operating system and version : Centos 8, Docker 20.10.1, Docker-compose 1.27.4
Nginx version of web container : 1.19.6-alpine
PHP version of nextcloud container : 7.4.14
Nginx reverse Proxy on another server : 1.18.0

The issue you are facing:
After migrating a working nextcloud server from older.anotherexample.net to old.example.org, I decided I wanted it under new.example.org.
After changing trusted_domains and overwrite settings the server is available through NEW, but it still redirects to OLD.
Some settings still only give OLD as an option, even though it is available through NEW. org.
The only reason my setup is working is because I redirect everything to NEW with my reverse proxy.

Is this the first time you’ve seen this error? : Y
I have migrated this server from ubuntu to the container and changed domain name at the same time from OLDER to OLD
It did not have any trouble with the change then.

Steps to replicate it:

  1. Install everything in containers under OLD domain name, tested everything works
  2. Edit reverse proxy servername, ssl certificates, config.php “trusted_domains”, “overwritehost”, and “overwrite.cli.url” to variations of NEW domain name
  3. Nextcloud available through NEW but redirection to OLD on login/logoff, caldav, and cron.
  4. In nextcloud “settings => system” External monitoring tool gives address : https ://old.example. org/nextcloud/ocs/v2.php/apps/serverinfo/api/v1/info
  5. In files => Settings WebDav is : https ://old.example. org/nextcloud/remote.php/dav/files/my_username/

The output of your Nextcloud log in Admin > Logging:

TypeError: Return value of OC\AppFramework\Http\Request::getServerHost() must be of the type string, array returned

    /var/www/html/lib/private/Route/Router.php - line 84:

    OC\AppFramework\Http\Request->getServerHost()

    /var/www/html/lib/private/Route/CachingRouter.php - line 42:

    OC\Route\Router->__construct(OC\Log {})

    /var/www/html/lib/private/Server.php - line 753:

    OC\Route\CachingRouter->__construct(OC\Memcache\APCu {}, OC\Log {})

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 155:

    OC\Server->OC\{closure}("*** sensiti ... *")

    /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php - line 118:

    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensiti ... *")

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 122:

    Pimple\Container->offsetGet("OCP\\Route\\IRouter")

    /var/www/html/lib/private/ServerContainer.php - line 156:

    OC\AppFramework\Utility\SimpleContainer->query("OCP\\Route\\IRouter", true)

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 87:

    OC\ServerContainer->query("OCP\\Route\\IRouter", true)

    <<closure>>

    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensiti ... *")

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 101:

    array_map(Closure {}, [ Reflection ... "])

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 109:

    OC\AppFramework\Utility\SimpleContainer->buildClass(ReflectionCl ... "})

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 126:

    OC\AppFramework\Utility\SimpleContainer->resolve("OC\\URLGenerator")

    /var/www/html/lib/private/ServerContainer.php - line 156:

    OC\AppFramework\Utility\SimpleContainer->query("OC\\URLGenerator", true)

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 56:

    OC\ServerContainer->query("OC\\URLGenerator")

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 177:

    OC\AppFramework\Utility\SimpleContainer->get("OC\\URLGenerator")

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 155:

    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensiti ... *")

    /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php - line 114:

    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensiti ... *")

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 122:

    Pimple\Container->offsetGet("OCP\\IURLGenerator")

    /var/www/html/lib/private/ServerContainer.php - line 156:

    OC\AppFramework\Utility\SimpleContainer->query("OCP\\IURLGenerator", true)

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 87:

    OC\ServerContainer->query("OCP\\IURLGenerator", true)

    <<closure>>

    OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}("*** sensiti ... *")

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 101:

    array_map(Closure {}, [ Reflection ... }])

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 109:

    OC\AppFramework\Utility\SimpleContainer->buildClass(ReflectionCl ... "})

    /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php - line 126:

    OC\AppFramework\Utility\SimpleContainer->resolve("OC\\Settings\\Manager")

    /var/www/html/lib/private/ServerContainer.php - line 156:

    OC\AppFramework\Utility\SimpleContainer->query("OC\\Settings\\Manager", true)

    /var/www/html/lib/private/Server.php - line 2191:

    OC\ServerContainer->query("OC\\Settings\\Manager")

    /var/www/html/lib/private/legacy/OC_App.php - line 212:

    OC\Server->getSettingsManager()

    /var/www/html/lib/private/legacy/OC_App.php - line 131:

    OC_App::loadApp("support")

    /var/www/html/lib/base.php - line 647:

    OC_App::loadApps([ "session"])

    /var/www/html/lib/base.php - line 1091:

    OC::init()

    /var/www/html/cron.php - line 42:

    require_once("/var/www/html/lib/base.php")

Loops every hour on every cron

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  '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,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis',
    'password' => '#####',
    'port' => 6379,
  ),
  'overwritehost' => 'new.example.org',
  'overwriteprotocol' => 'https',
  'overwritewebroot' => '/nextcloud',
  'passwordsalt' => '#####',
  'secret' => '######',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'new.example.org',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '20.0.4.0',
  'overwrite.cli.url' => 'https://new.example.org/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '######',
  'dbpassword' => '######',
  'installed' => true,
  'instanceid' => '#####',
  'maintenance' => false,
  'data-fingerprint' => '#####',
  'updater.secret' => '#####',
  'overwritehost=' => '',
);

Nginx config of web container :

upstream php-handler {
   server app:9000;
}

server {
   listen 80;

   access_log  /var/log/nginx/nc_access.log;
   error_log  /var/log/nginx/nc_error.log;

   # Add headers to serve security related headers
#   add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always;
   add_header Referrer-Policy "no-referrer" always;
   add_header X-Content-Type-Options "nosniff" always;
   add_header X-Download-Options "noopen" always;
   add_header X-Frame-Options "SAMEORIGIN" always;
   add_header X-Permitted-Cross-Domain-Policies "none" always;
   add_header X-Robots-Tag "none" always;
   add_header X-XSS-Protection "1; mode=block" always;

   # Remove X-Powered-By, which is an information leak
   fastcgi_hide_header X-Powered-By;

   # Path to the root of your installation
   root /var/www/html;

   location = /robots.txt {
      allow all;
      log_not_found off;
      access_log off;
   }

    location = /.well-known/carddav { return 301 $scheme://$host:$server_port/remote.php/dav; }
    location = /.well-known/caldav { return 301 $scheme://$host:$server_port/remote.php/dav; }

   # set max upload size
   client_max_body_size 10G;
   fastcgi_buffers 64 4K;

   # Enable gzip but do not remove ETag headers
   gzip on;
   gzip_vary on;
   gzip_comp_level 4;
   gzip_min_length 256;
   gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
   gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml applicati$

   location /   { rewrite ^ /index.php; }

   location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/   { deny all; }
   location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console)            { deny all; }

   location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
         fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
         set $path_info $fastcgi_path_info;
         try_files $fastcgi_script_name =404;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_param PATH_INFO $path_info;
         # fastcgi_param HTTPS on;

         # Avoid sending the security headers twice
         fastcgi_param modHeadersAvailable true;

         # Enable pretty urls
         fastcgi_param front_controller_active true;
         fastcgi_pass php-handler;
         fastcgi_intercept_errors on;
         fastcgi_request_buffering off;
   }

   location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
         try_files $uri/ =404;
         index index.php;
   }

   # Adding the cache control header for js, css and map files
   # Make sure it is BELOW the PHP block
   location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
         try_files $uri /index.php$request_uri;
         add_header Cache-Control "public, max-age=15778463";
         # Add headers to serve security related headers (It is intended to
         # have those duplicated to the ones above)
#         add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always;
         add_header Referrer-Policy "no-referrer" always;
         add_header X-Content-Type-Options "nosniff" always;
         add_header X-Download-Options "noopen" always;
         add_header X-Frame-Options "SAMEORIGIN" always;
         add_header X-Permitted-Cross-Domain-Policies "none" always;
         add_header X-Robots-Tag "none" always;
         add_header X-XSS-Protection "1; mode=block" always;

         # Optional: Don't log access to assets
         access_log off;
   }

   location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ {
      try_files $uri /index.php$request_uri;
      # Optional: Don't log access to other assets
      access_log off;
   }
}

Reverse proxy config (combined) :

server {
        listen 443 ssl; # managed by Certbot
        server_name *.example.org example.org;

        include cert_stuff_here;

        access_log /var/log/nginx/example_redirect.access.log;
        error_log /var/log/nginx/example_redirect.error.log;

## This part makes all old.example.org go to new.example.org, if old.example.org was still 
## configured on it's own, I would see whatever it was directing to and not my nextcloud app

        return 302  https://new.example.org$request_uri;
}

server {
        listen 443 ssl; # managed by Certbot
        server_name new.example.org;

        include cert_stuff_here;

        error_page 404 /404.html;
        location = /40x.html {
        }
        access_log /var/log/nginx/example_new.access.log;
        error_log /var/log/nginx/example_new.error.log;

        location / {
                try_files $uri $uri/ =404;
        }

   location /.well-known {
      # The following 6 rules are borrowed from `.htaccess`

      rewrite ^/\.well-known/host-meta\.json  /nextcloud/public.php?service=host-meta-json    last;
      rewrite ^/\.well-known/host-meta        /nextcloud/public.php?service=host-meta         last;
      rewrite ^/\.well-known/webfinger        /nextcloud/public.php?service=webfinger         last;
      rewrite ^/\.well-known/nodeinfo         /nextcloud/public.php?service=nodeinfo          last;

      location = /.well-known/carddav  { return 301 /nextcloud/remote.php/dav/; }
      location = /.well-known/caldav   { return 301 /nextcloud/remote.php/dav/; }

      try_files $uri $uri/ =404;
   }

    location /nextcloud/ {
        proxy_pass         http://nextcloud_app_ip/;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto    $scheme;
        proxy_http_version 1.1;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Upgrade $http_upgrade;
        client_max_body_size 1G;
        proxy_read_timeout 36000s;
        add_header Strict-Transport-Security "max-age=15768000; includeSubdomains;";
    }

}

The output of your nginx log in web container :

==> /var/log/nginx/nc_access.log <==
192.168.168.50 - - [17/Jan/2021:16:34:17 +0000] "GET /login?clear=1 HTTP/1.1" 200 5929 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:18 +0000] "GET /js/core/merged-template-prepend.js?v=30a6e934-0 HTTP/1.1" 200 2982 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:18 +0000] "GET /apps/accessibility/css/user-a82fd95db10ff25dfad39f07372ebe37 HTTP/1.1" 200 3967 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:18 +0000] "GET /apps/theming/styles?v=0 HTTP/1.1" 200 483 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:24 +0000] "POST /login HTTP/1.1" 303 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:29 +0000] "GET /apps/dashboard/ HTTP/1.1" 200 9588 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/core/dd86-01a9-server.css?v=32ef7dc01a3ffbcbbaf8fb9483f9bd03-30a6e934-0 HTTP/1.1" 200 19547 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/core/dd86-01a9-css-variables.css?v=32ef7dc01a3ffbcbbaf8fb9483f9bd03-30a6e934-0 HTTP/1.1" 200 591 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/notifications/0577-01a9-styles.css?v=32ef7dc01a3ffbcbbaf8fb9483f9bd03-05770f32-0 HTTP/1.1" 200 846 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/dashboard/d149-01a9-dashboard.css?v=32ef7dc01a3ffbcbbaf8fb9483f9bd03-d149f1ad-0 HTTP/1.1" 200 602 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/activity/a3ad-01a9-style.css?v=32ef7dc01a3ffbcbbaf8fb9483f9bd03-a3adcb3d-0 HTTP/1.1" 200 1108 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/text/232d-01a9-icons.css?v=32ef7dc01a3ffbcbbaf8fb9483f9bd03-232de555-0 HTTP/1.1" 200 417 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/notes/5bae-01a9-global.css?v=32ef7dc01a3ffbcbbaf8fb9483f9bd03-5baeb58a-0 HTTP/1.1" 200 110 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /js/activity/activity-sidebar.js?v=30a6e934-0 HTTP/1.1" 200 5776 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /css/icons/icons-vars.css?v=1610845428 HTTP/1.1" 200 38705 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:30 +0000] "GET /avatar/Fluffy/32?v=1 HTTP/1.1" 200 181 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:31 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 81 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:31 +0000] "GET /ocs/v2.php/search/providers?from=%2Fnextcloud%2Fapps%2Fdashboard%2F HTTP/1.1" 200 204 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:31 +0000] "GET /ocs/v2.php/apps/weather_status/api/v1/location HTTP/1.1" 200 102 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:31 +0000] "GET /apps/recommendations/api/recommendations/always HTTP/1.1" 200 343 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:32 +0000] "GET /apps/notes/notes/dashboard HTTP/1.1" 200 813 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.50 - - [17/Jan/2021:16:34:32 +0000] "GET /apps/theming/img/core/filetypes/x-office-spreadsheet.svg?v=0 HTTP/1.1" 200 221 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

Reverse proxy logs:

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:09 -0500] "GET /nextcloud/ocs/v2.php/apps/text/workspace?path=%2F HTTP/2.0" 200 158 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:09 -0500] "GET /nextcloud/apps/text/js/vendors~editor~files-modal.js?v=178cce217ef583dcddc2 HTTP/2.0" 200 28120 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:09 -0500] "GET /nextcloud/apps/text/js/vendors~editor.js?v=a38dbbdd0254879ac847 HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:09 -0500] "GET /nextcloud/apps/text/js/editor.js?v=933a8d1c0265021150fd HTTP/2.0" 200 23364 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:09 -0500] "PROPFIND /nextcloud/remote.php/dav/files/Fluffy/ HTTP/2.0" 207 1041 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:09 -0500] "GET /nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/2.0" 200 203 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:09 -0500] "PUT /nextcloud/apps/text/session/create HTTP/2.0" 200 292 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:10 -0500] "GET /nextcloud/apps/text/js/vendors~editor-collab~editor-guest~editor-rich~files-modal.js?v=922928e0be102d041d44 HTTP/2.0" 200 9504 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:10 -0500] "GET /nextcloud/apps/text/js/vendors~editor-collab~editor-guest.js?v=18b2db1a3bd404ba4b2b HTTP/2.0" 200 35523 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:10 -0500] "POST /nextcloud/apps/text/session/fetch HTTP/2.0" 200 34 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:10 -0500] "GET /nextcloud/apps/text/js/highlight/markdown.js?v=1828707056cc01042d2e HTTP/2.0" 200 561 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:10 -0500] "GET /nextcloud/apps/recommendations/api/recommendations HTTP/2.0" 200 343 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:10 -0500] "POST /nextcloud/apps/text/session/sync HTTP/2.0" 200 250 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/logout?requesttoken=AI839do7GTqHliGIxbZWKy3ou%2BEveQg5I1JKdAYBRMI%3D%3AZ8R5pKlhb3%2F2%2B2zrnNMaUm%2Fe1dRrFX9fexQ6EVRufIU%3D HTTP/2.0" 303 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_redirect.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/login?clear=1 HTTP/2.0" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/login?clear=1 HTTP/2.0" 303 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_redirect.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/login?clear=1 HTTP/2.0" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/login?clear=1 HTTP/2.0" 200 5929 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/core/js/dist/main.js?v=30a6e934-0 HTTP/2.0" 200 455181 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/core/js/dist/files_fileinfo.js?v=30a6e934-0 HTTP/2.0" 200 8968 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/core/js/dist/files_client.js?v=30a6e934-0 HTTP/2.0" 200 42593 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/apps/files_sharing/js/dist/main.js?v=30a6e934-0 HTTP/2.0" 200 594 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/apps/files_pdfviewer/js/files_pdfviewer-public.js?v=30a6e934-0 HTTP/2.0" 200 7797 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/apps/files_videoplayer/js/main.js?v=30a6e934-0 HTTP/2.0" 200 2960 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/apps/files_rightclick/js/script.js?v=30a6e934-0 HTTP/2.0" 200 3365 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/apps/files_rightclick/js/files.js?v=30a6e934-0 HTTP/2.0" 200 1305 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/apps/theming/js/theming.js?v=30a6e934-0 HTTP/2.0" 200 60 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/apps/files_rightclick/css/app.css?v=46c85d58-0 HTTP/2.0" 200 201 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/core/css/guest.css?v=30a6e934-0 HTTP/2.0" 200 5703 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:13 -0500] "GET /nextcloud/core/js/dist/login.js?v=30a6e934-0 HTTP/2.0" 200 254013 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:14 -0500] "GET /nextcloud/js/core/merged-template-prepend.js?v=30a6e934-0 HTTP/2.0" 200 2982 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:14 -0500] "GET /nextcloud/apps/accessibility/css/user-a82fd95db10ff25dfad39f07372ebe37 HTTP/2.0" 200 3955 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:14 -0500] "GET /nextcloud/apps/theming/styles?v=0 HTTP/2.0" 200 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:14 -0500] "GET /nextcloud/core/img/loading-dark.gif HTTP/2.0" 200 4683 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:14 -0500] "GET /nextcloud/core/img/actions/toggle.svg HTTP/2.0" 200 228 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:14 -0500] "GET /nextcloud/core/img/favicon-touch.png HTTP/2.0" 200 2918 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:14 -0500] "GET /nextcloud/core/img/favicon.ico HTTP/2.0" 200 720 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_redirect.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:21 -0500] "GET /nextcloud/login?clear=1 HTTP/2.0" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:21 -0500] "GET /nextcloud/login?clear=1 HTTP/2.0" 200 5924 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:22 -0500] "GET /nextcloud/core/img/favicon-touch.png HTTP/2.0" 200 2918 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:22 -0500] "GET /nextcloud/core/img/favicon.ico HTTP/2.0" 200 720 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:24 -0500] "GET /nextcloud/login?clear=1 HTTP/2.0" 200 5928 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:24 -0500] "GET /nextcloud/core/img/favicon-touch.png HTTP/2.0" 200 2918 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:24 -0500] "GET /nextcloud/core/img/favicon.ico HTTP/2.0" 200 720 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:26 -0500] "GET /nextcloud HTTP/2.0" 301 169 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:26 -0500] "GET /nextcloud/ HTTP/2.0" 302 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_redirect.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:26 -0500] "GET /nextcloud/login HTTP/2.0" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:26 -0500] "GET /nextcloud/login HTTP/2.0" 200 5932 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:33 -0500] "POST /nextcloud/login HTTP/2.0" 303 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_redirect.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/dashboard/ HTTP/2.0" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/dashboard/ HTTP/2.0" 200 9586 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/accessibility/js/accessibilityoca.js?v=30a6e934-0 HTTP/2.0" 200 4089 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/notifications/js/notifications-main.js?v=30a6e934-0 HTTP/2.0" 200 231779 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/files/js/dist/sidebar.js?v=30a6e934-0 HTTP/2.0" 200 173486 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/files/js/fileinfomodel.js?v=30a6e934-0 HTTP/2.0" 200 1266 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/comments/js/comments.js?v=30a6e934-0 HTTP/2.0" 200 19459 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/files_versions/js/files_versions.js?v=30a6e934-0 HTTP/2.0" 200 10767 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/files_sharing/js/dist/files_sharing_tab.js?v=30a6e934-0 HTTP/2.0" 200 293232 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/files_pdfviewer/js/files_pdfviewer-main.js?v=30a6e934-0 HTTP/2.0" 200 9511 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/text/js/viewer.js?v=30a6e934-0 HTTP/2.0" 200 9089 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/viewer/js/viewer-main.js?v=30a6e934-0 HTTP/2.0" 200 379748 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/custom_apps/richdocuments/js/viewer.js?v=30a6e934-0 HTTP/2.0" 200 160319 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/apps/weather_status/js/weather-status.js?v=30a6e934-0 HTTP/2.0" 200 267635 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.168.1 - - [17/Jan/2021:12:21:34 -0500] "GET /nextcloud/custom_apps/notes/js/notes-dashboard.js?v=30a6e934-0 HTTP/2.0" 200 424984 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

and more of the same

where do you redirect from http to https?
and did you try a grep -r old.example.org * in your config folders?

It’s done in the reverse proxy, it does not seem to be causing problems so I deleted it to be under the 32k limit.

server {
   listen 80;
   server_name *.example.org example.org;

   access_log  /var/log/nginx/example_http.access.log;
   error_log  /var/log/nginx/example_http.error.log;

   return 302   https://$host$request_uri;
}

An example of the log for that when I go to example.org:80/nextcloud :

==> /var/log/nginx/example_redirect.access.log <==
192.168.168.1 - - [17/Jan/2021:14:32:01 -0500] "GET /nextcloud/login HTTP/2.0" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:14:32:01 -0500] "GET /nextcloud/login HTTP/2.0" 200 5932 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_http.access.log <==
192.168.168.1 - - [17/Jan/2021:14:32:10 -0500] "GET /nextcloud/login HTTP/1.1" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_redirect.access.log <==
192.168.168.1 - - [17/Jan/2021:14:32:10 -0500] "GET /nextcloud/login HTTP/2.0" 302 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

==> /var/log/nginx/example_new.access.log <==
192.168.168.1 - - [17/Jan/2021:14:32:10 -0500] "GET /nextcloud/login HTTP/2.0" 200 5928 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

Looking up the old domain name in the reverse proxy only gives out .bash_history
It’s not finding anything in the nextcloud containers.

I’m thinking something in the database not updating to the new domain name, but I don’t know where.

This problem is making it impossible to use the desktop or android app.

On the grant page navigator’s console gives out :
Content Security Policy: The page’s settings blocked the loading of a resource at https://old.example.org/nextcloud/login/v2/grant (“form-action”).

Android app gives :
Invalid Request

Slowly getting somewhere.

I found something weird.
The config file overwritehost is set to new.example.org.
If I do docker exec -u www-data nextcloud_app_1 php occ config:system:get overwritehost it gives out old.example.org.
I did docker exec -u www-data nextcloud_app_1 php occ config:system:set overwritehost --value=new.example.org
It gives out System config value overwritehost set to string new.example.org
Yet if I get overwritehost it still gives out the OLD address.

I tried to find if this was set anywhere in the database and I’m just not finding anything except a few deleted app data that still have the OLDER address set.

I was not able to figure out how to change the settings while the server was running.

I added the setting in the environment settings of my docker-compose file - OVERWRITEHOST=new.example.org and restarted everything.
It now works as it should.

For some reason the container does not take into consideration some changes made while it is online as I was able to add trusted domains and proxies without trouble.

Not really about this, but I am kinda sad that doing this all my local files were deleted and re-downloaded even though they were the same files, just not under the same domain name.