Nextcloud version (eg, 29.0.5): 28.0.5
Operating system and version (eg, Ubuntu 24.04): Ubuntu 24.04
Apache or nginx version (eg, Apache 2.4.25): I am using the nextcloud:28.0.5-apache Docker image
PHP version (eg, 8.3): Whatever is installed in nextcloud:28.0.5-apache
The issue you are facing:
This is yet another “X-Forwarded-For” stuff being ignored and I have worked through many issues in the past, still have not found a solution in my Docker Swarm installation of NextCloud. Other services work fine.
X-Forward-For HTTP header is not respected → Nextcloud only sees the IP of the reverse proxy, which sometimes changes, depending where it is spawned in the Swarm. Every single log shows the IP of the load balancer / reverse proxy.
The HTTP header contains the x-forward-for entry with the correct IP address and other services in the Docker Swarm are also using that and work correctly. NextCloud ignores it.
Here, the IP of the load balancer (inside the Docker Swarm, an HAProxy service) is 10.0.9.228
cloud_nextcloud | 10.0.9.228 - - [12/Jul/2024:08:47:43 +0000] "HEAD / HTTP/1.0" 302 1632 "-" "-"
cloud_nextcloud | 10.0.9.228 - - [12/Jul/2024:08:47:44 +0000] "GET / HTTP/1.1" 302 1658 "-" "Telegraf/1.25.2 Go/1.20"
Is this the first time you’ve seen this error? (Y/N): N
Steps to replicate it:
- Deploy
nextcloud:28.0.5-apachebehind HAProxy
The output of your Nextcloud log in Admin > Logging: nothing relevant.
The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'loglevel' => 2,
'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,
),
'passwordsalt' => '...',
'secret' => '...',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'cloud.institute.org',
2 => '10.0.*.*',
3 => '10.0.9.228',
4 => '10.0.0.0/16'
),
'trusted_proxies' =>
array (
0 => '10.0.*.*',
1 => '10.0.9.228',
2 => '10.0.0.0/16'
),
'forwarded_for_headers' =>
array (
0 => 'HTTP_X_FORWARDED_FOR',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '28.0.5.1',
'overwrite.cli.url' => 'http://localhost',
'overwriteprotocol' => 'https',
'dbname' => '...',
'dbhost' => 'mariadb',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => '...',
'dbpassword' => '...',
'installed' => true,
'instanceid' => '...',
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
'mail_smtpmode' => 'smtp',
'mail_smtpauthtype' => 'PLAIN',
'mail_sendmailmode' => 'smtp',
'mail_smtpauth' => 1,
'mail_smtphost' => '...',
'mail_smtpsecure' => 'ssl',
'mail_smtpport' => '465',
'mail_from_address' => '...',
'mail_smtpname' => '...',
'mail_smtppassword' => '...',
'mail_domain' => 'fau.de',
'maintenance' => false,
);
The output of your Apache/nginx/system log in /var/log/____:
cloud_nextcloud | 10.0.9.228 - - [12/Jul/2024:08:47:43 +0000] "HEAD / HTTP/1.0" 302 1632 "-" "-"
cloud_nextcloud | 10.0.9.228 - - [12/Jul/2024:08:47:44 +0000] "GET / HTTP/1.1" 302 1658 "-" "Telegraf/1.25.2 Go/1.20"
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
No errors
