Android App broken after reverse proxy (Sophos XG)

Nextcloud version (eg, 20.0.5): 23.0.5
Operating system and version (eg, Ubuntu 20.04): 20.04.4
Apache or nginx version (eg, Apache 2.4.25): 2.4.41
PHP version (eg, 7.4): 7.4.3

Dear Comm.

I’m facing an issue that’s already mentioned here in the forum, but I’m still not familiar with what to do to fix it. (Nextcloud Android App doesn't work with reverse Proxy) Sorry, can’t upload the picture from the theard, I’ve got an error.

I do not have an running reverse proxy on as an part of the Nextcloud installation, so I didn’t know where or even if I should and need to add entrys like ProxyPass / ProxyPassReverse.

I have an VM Image of Nextcloud from hanssonit.se and I use an separated Sophos XG VM as an firewall and reverse proxy.

Currently, my Nextcloud installation is behind the Sophos XG, but without reverse proxy authentication, where everything is running like expected, browser, Android app, notes, password manager and so on…

But, as soon as I enable the reverse proxy, the android app looks like an normal browser access… Anyone an idea what I’m missing and where to set it up?

See config.php (/var/www/nextcloud/config) at the bottom.

I have replaced all sensitive information like usernames / passwords with xxxxxxxxxxxxxxxxxxxxxxxxxx, also all IP addresses with 111.111.111.111 and all fqdn names with my-domain.ch or .local.

Many thanks for your help!

Best
Adnan

<?php $CONFIG = array ( 'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'cloud.my-domain.local', 2 => 'cloud.my-domain.ch', 3 => '111.111.111.111', ), 'trusted_proxies' => array ( 0 => '111.111.111.111', 1 => 'proxy.my-domain.ch', 2 => 'proxy.my-domain.local', ), 'datadirectory' => '/mnt/ncdata', 'dbtype' => 'pgsql', 'version' => '23.0.5.1', 'overwrite.cli.url' => 'http://localhost/', 'dbname' => 'nextcloud_db', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx', 'dbpassword' => 'xxxxxxxxxxxxxxxxxxxxxxx', 'installed' => true, 'instanceid' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx', 'upgrade.disable-web' => true, 'log_type' => 'file', 'logfile' => '/var/log/nextcloud/nextcloud.log', 'loglevel' => '2', 'log.condition' => array ( 'apps' => array ( 0 => 'admin_audit', ), ), 'mail_smtpmode' => 'smtp', 'remember_login_cookie_lifetime' => '1800', 'log_rotate_size' => '10485760', 'trashbin_retention_obligation' => 'auto, 60', 'versions_retention_obligation' => 'auto, 180', 'activity_expire_days' => '120', 'simpleSignUpLink.shown' => false, 'memcache.local' => '\\OC\\Memcache\\Redis', 'filelocking.enabled' => true, 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/var/run/redis/redis-server.sock', 'port' => 0, 'timeout' => 0.5, 'dbindex' => 0, 'password' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx', ), 'default_phone_region' => 'ch', 'logtimezone' => 'Europe/Zurich', 'htaccess.RewriteBase' => '/', 'enable_previews' => true, 'enabledPreviewProviders' => array ( 11 => 'OC\\Preview\\PNG', 12 => 'OC\\Preview\\JPEG', 13 => 'OC\\Preview\\GIF', 14 => 'OC\\Preview\\BMP', 15 => 'OC\\Preview\\MarkDown', 16 => 'OC\\Preview\\MP3', 17 => 'OC\\Preview\\TXT', 18 => 'OC\\Preview\\Movie', ), 'preview_max_x' => '2048', 'preview_max_y' => '2048', 'jpeg_quality' => '60', 'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory', 'maintenance' => false, 'mail_sendmailmode' => 'smtp', 'mail_from_address' => 'info', 'mail_domain' => 'my-domain.ch', 'mail_smtphost' => '111.111.111.111', 'mail_smtpport' => '25', 'preview_max_memory' => '1280', );

Hey Comm.

Just to let you know, I’ve got an workarround… I think it’s something related to the Sophos instead Nextcloud…

I’ve configured path specific routing, and added follow config:

path / = no authentication
path /login = authentication (reverse proxy)

With that config, the android app is working like it should.

Best
Adnan