Nextcloud 20 very slow when overwritehost and overwriteprotocol set in config.php

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 20.0.4
Operating system and version (eg, Ubuntu 20.04):Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.4.13

The issue you are facing:Recently my Nextcloud installation has become very slow. After some troubleshooting, I ended up doing a fresh installation. What I discovered is that Nextcloud becomes very slow when I set the overwritehost and overwriteprotocol fields in the config.php file. If I remove these fields the web page moves much faster. I’m running the Nextcloud:latest docker image and an Nginx reverse proxy, so I need to set these fields or the Android app will try to connect to its own localhost instead of the real URL.

Is this the first time you’ve seen this error? (Y/N):Y

Steps to replicate it:

  1. Install Nextcloud Docker container behind Nginx reverse proxy.
  2. Set overwritehost and overwriteprotocol fields in config.php.
  3. Restart Docker container.

The output of your Nextcloud log in Admin > Logging:


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


The output of your Apache/nginx/system log in /var/log/____: