Problem to login behind nginx proxy

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com 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:

example

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

longer
example
here

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): 18.0.4
Operating system and version (eg, Ubuntu 20.04): Debian 9
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.1): 7.4

The issue you are facing:
From the beginning I only published my Nextcloud with https and forwarded 443 in my router to my NC device. Now I need to publish more things and then found nginx-proxy-manager, https://github.com/jc21/nginx-proxy-manager. I run NC at one Debian device and nginx-proxy-manager at another device. I now forward 443 and 80 to my nginx-proxy-manager device in the router and other things I publish works great. The problem I am facing with this solution is that when trying to login to NC it just hangs and loading. If I refresh the page it jumps to the page after login.
Another case is that when using the new authentication (v2) when signing is at Windows or iOS NC application. You will then be redirected to the web page and need to login and press grant access. In this stage it is not possible to press refresh to get further, the login starts from the beginning.
I think some parameter is missing in my config after I moved from only Apache2 directly to nginx proxy before Apache2.

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

The output of your Nextcloud log in Admin > Logging:

Error	PHP	Trying to access array offset on value of type bool at /var/www/nextcloud/apps/files_versions/lib/Storage.php#654

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

<?php
$CONFIG = array (
  'instanceid' => 'oc8ohlj8p16p',
  'passwordsalt' => 'ABC123',
  'secret' => 'ABC123',
  'trusted_domains' =>
  array (
    0 => 'sub.domain.se',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'overwrite.cli.url' => 'http://sub.domain.se',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'dbname' => 'mydbname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud_user',
  'dbpassword' => 'ABC123',
  'installed' => true,
  'maintenance' => false,
  'htaccess.RewriteBase' => '/',
  'filelocking.enabled' => true,
  'theme' => '',
  'loglevel' => 2,
  'mail_domain' => 'domain.se',
  'mail_from_address' => 'subdomain',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp....',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'mail@domain.se',
  'mail_smtppassword' => 'ABC123',
  'updater.secret' => 'ABC123',
  'updater.release.channel' => 'stable',
);

This is my virtual host config in Apache2:

<VirtualHost *:80>
        ServerName sub.domain.se

        ServerAdmin mail@domain.se
        DocumentRoot /var/www/nextcloud

        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/nextcloud>
                Options Indexes Includes FollowSymLinks MultiViews
                #AllowOverride AuthConfig
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

This is the config I found for nginx in nginx-proxy-manager GUI

{
  "domain_names": [
    "sub.domain.se"
  ],
  "forward_scheme": "http",
  "forward_host": "192.168.10.100",
  "forward_port": 80,
  "caching_enabled": true,
  "block_exploits": true,
  "allow_websocket_upgrade": true,
  "access_list_id": 0,
  "ssl_forced": false,
  "http2_support": false,
  "hsts_enabled": false,
  "meta": {
    "letsencrypt_email": "mail@domain.se",
    "letsencrypt_agree": true,
    "nginx_online": true,
    "nginx_err": null
  },
  "advanced_config": "",
  "locations": [],
  "hsts_subdomains": false,
  "owner_user_id": 1
}

did you ever resolve this? I’m having the same problem.
Thanks

Unfortunately not, I publish the other thing another way so I can use Apache for Nextcloud for now.