Switching from http to https and back

OS Ubuntu 20.04
Nextcloud version 20.0.1
Nginx 1.18
PHP 7.4

Nginx was configured to use https with self-signed certificates, there is a redirect from http to https. After these settings, NextClood is available. But when you try to disable https, the Nextcloud redirect loop on login.

config file nginx with http

upstream php-handler {
    # server 127.0.0.1:9000;
    server unix:/var/run/php/php7.4-fpm.sock;
}

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name testnextcloud.nextcloud.kz;

    # Use Mozilla's guidelines for SSL/TLS settings
    # https://mozilla.github.io/server-side-tls/ssl-config-generator/
    # NOTE: some settings below might be redundant
    # ssl_certificate /etc/ssl/certs/nextcloud-selfsigned.crt;
    # ssl_certificate_key /etc/ssl/private/nextcloud-selfsigned.key;

    # Add headers to serve security related headers
    # Before enabling Strict-Transport-Security headers please read into this
    # topic first.
    # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;" always;
    #
    # WARNING: Only add the preload option once you read about
    # the consequences in https://hstspreload.org/. This option
    # will add the domain to a hardcoded list that is shipped
    # in all major browsers and getting removed from this list
    # could take several months.
    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/nextcloud;

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

    # The following 2 rules are only needed for the user_webfinger app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

    # The following rule is only needed for the Social app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/webfinger /public.php?service=webfinger last;

    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 512M;
    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 application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

    # Uncomment if your server is build with the ngx_pagespeed module
    # This module is currently not supported.
    #pagespeed off;

    location / {
        rewrite ^ /index.php;
    }
	location /netdata {
	return 301 /netdata/;
	}
	location ~ /netdata/(?<ndpath>.*) {
	auth_basic "Bitte Zugangsdaten eingeben";
	auth_basic_user_file /etc/nginx/netdata-access;
	proxy_http_version 1.1;
	proxy_pass_request_headers on;
	proxy_set_header Connection "keep-alive";
	proxy_store off;
	proxy_pass http://netdata/$ndpath$is_args$args;
	gzip on;
	gzip_proxied any;
	gzip_types *;
	}


    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\/.+|.+\/richdocumentscode\/proxy)\.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)
        # Before enabling Strict-Transport-Security headers please read into
        # this topic first.
        #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
        #
        # WARNING: Only add the preload option once you read about
        # the consequences in https://hstspreload.org/. This option
        # will add the domain to a hardcoded list that is shipped
        # in all major browsers and getting removed from this list
        # could take several months.
        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;
    }
}

config file nginx with https (everything else is the same http)

[...]
server {
    listen 80;
    listen [::]:80;
    server_name testnextcloud.nextcloud.kz;
    # enforce https
    return 301 https://$server_name:443$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name testnextcloud.nextcloud.kz;
[...]
}

nextcloud config file

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "testnextcloud.nextcloud.kz",
            "172.21.0.98"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "20.0.1.1",
        "overwrite.cli.url": "http:\/\/testnextcloud.nextcloud.kz",
        "overwritehost": "testnextcloud.nextcloud.kz",
        "overwriteprotocol": "http",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "versions_retention_obligation": "auto, 365",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "memcache.local": "\\OC\\Memcache\\APCu",
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": "2",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "remember_login_cookie_lifetime": "1800",
        "log_rotate_size": "10485760",
        "trashbin_retention_obligation": "auto, 180",
        "simpleSignUpLink.shown": false,
        "default_language": "ru",
        "defaultapp": "files",
        "auth.bruteforce.protection.enabled": true,
        "maintenance": false,
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "skeletondirectory": "\/var\/www\/nextcloud\/core\/skeleton"
    },
}

Nextcloud log:

{"reqId":"J20bTO3jsDlSc4qULZB9","level":3,"time":"2020-11-05T07:00:07+00:00","remoteAddr":"172.21.0.36","user":"ncadmin","app":"PHP","method":"GET","url":"/settings/user","message":{"Exception":"Error","Message":"Undefined offset: 3 at /var/www/nextcloud/lib/private/legacy/OC_Helper.php#548","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/legacy/OC_Helper.php","line":548,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/apps/settings/lib/Settings/Personal/PersonalInfo.php","line":108,"function":"getStorageInfo","class":"OC_Helper","type":"::"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":141,"function":"getForm","class":"OCA\\Settings\\Settings\\Personal\\PersonalInfo","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/PersonalSettingsController.php","line":77,"function":"formatSettings","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":152,"function":"getSettings","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/PersonalSettingsController.php","line":68,"function":"getIndexResponse","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"index","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":308,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1009,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"20.0.1.1"}
{"reqId":"WBiUW21WlFctVnV7EzbG","level":3,"time":"2020-11-05T07:00:50+00:00","remoteAddr":"172.21.0.36","user":"ncadmin","app":"jsresourceloader","method":"GET","url":"/settings/admin/workflow","message":"Could not find resource core/js/files/fileinfo.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"20.0.1.1"}
{"reqId":"WBiUW21WlFctVnV7EzbG","level":3,"time":"2020-11-05T07:00:50+00:00","remoteAddr":"172.21.0.36","user":"ncadmin","app":"jsresourceloader","method":"GET","url":"/settings/admin/workflow","message":"Could not find resource core/js/files/client.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"20.0.1.1"}
{"reqId":"PpH1he9j52ijUJI1D4nr","level":3,"time":"2020-11-05T07:00:54+00:00","remoteAddr":"172.21.0.36","user":"ncadmin","app":"jsresourceloader","method":"GET","url":"/settings/user/workflow","message":"Could not find resource core/js/files/fileinfo.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"20.0.1.1"}
{"reqId":"PpH1he9j52ijUJI1D4nr","level":3,"time":"2020-11-05T07:00:54+00:00","remoteAddr":"172.21.0.36","user":"ncadmin","app":"jsresourceloader","method":"GET","url":"/settings/user/workflow","message":"Could not find resource core/js/files/client.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"20.0.1.1"}
{"reqId":"wcp8uLV4dPq77vCsQBMh","level":3,"time":"2020-11-05T07:01:04+00:00","remoteAddr":"172.21.0.36","user":"ncadmin","app":"PHP","method":"GET","url":"/apps/files/","message":{"Exception":"Error","Message":"Undefined offset: 3 at /var/www/nextcloud/lib/private/legacy/OC_Helper.php#548","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/legacy/OC_Helper.php","line":548,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/ViewController.php","line":139,"function":"getStorageInfo","class":"OC_Helper","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/ViewController.php","line":187,"function":"getStorageInfo","class":"OCA\\Files\\Controller\\ViewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"index","class":"OCA\\Files\\Controller\\ViewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":308,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1009,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"20.0.1.1"}
{"reqId":"1aYH9mqeBxpRuVghmEiZ","level":3,"time":"2020-11-05T07:01:08+00:00","remoteAddr":"172.21.0.36","user":"ncadmin","app":"PHP","method":"GET","url":"/index.php/apps/files/ajax/getstoragestats.php?dir=%2F","message":{"Exception":"Error","Message":"Undefined offset: 3 at /var/www/nextcloud/lib/private/legacy/OC_Helper.php#548","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/legacy/OC_Helper.php","line":548,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Helper.php","line":51,"function":"getStorageInfo","class":"OC_Helper","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/AjaxController.php","line":47,"function":"buildFileStorageStatistics","class":"OCA\\Files\\Helper","type":"::"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"getStorageStats","class":"OCA\\Files\\Controller\\AjaxController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":308,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1009,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"20.0.1.1"}

nginx log file:

2020/11/05 11:43:16 [error] 11479#11479: *15 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "localhost"
2020/11/05 11:43:16 [error] 11479#11479: *16 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:16 [error] 11479#11479: *17 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status?full&json HTTP/1.1", host: "localhost"
2020/11/05 11:43:16 [error] 11479#11479: *18 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status?full&json HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:17 [error] 11479#11479: *21 open() "/usr/share/nginx/html/us" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /us HTTP/1.1", host: "localhost"
2020/11/05 11:43:17 [error] 11479#11479: *22 open() "/usr/share/nginx/html/us" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /us HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:17 [error] 11479#11479: *23 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "localhost"
2020/11/05 11:43:17 [error] 11479#11479: *24 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:17 [error] 11479#11479: *25 open() "/usr/share/nginx/html/admin/api.php" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /admin/api.php?version HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:17 [error] 11479#11479: *26 open() "/usr/share/nginx/html/admin/api.php" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /admin/api.php?version HTTP/1.1", host: "localhost"
2020/11/05 11:43:18 [error] 11479#11479: *27 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?format=plain HTTP/1.1", host: "localhost"
2020/11/05 11:43:18 [error] 11479#11479: *28 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?format=plain HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:18 [error] 11479#11479: *29 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "localhost"
2020/11/05 11:43:18 [error] 11479#11479: *30 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:25 [error] 11479#11479: *34 open() "/usr/share/nginx/html/admin/api.php" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /admin/api.php?version HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:25 [error] 11479#11479: *35 open() "/usr/share/nginx/html/admin/api.php" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /admin/api.php?version HTTP/1.1", host: "localhost"
2020/11/05 11:43:25 [error] 11479#11479: *36 open() "/usr/share/nginx/html/us" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /us HTTP/1.1", host: "localhost"
2020/11/05 11:43:25 [error] 11479#11479: *37 open() "/usr/share/nginx/html/us" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /us HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:25 [error] 11479#11479: *38 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "localhost"
2020/11/05 11:43:25 [error] 11479#11479: *39 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:25 [error] 11479#11479: *40 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "localhost"
2020/11/05 11:43:25 [error] 11479#11479: *41 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:25 [error] 11479#11479: *42 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status?full&json HTTP/1.1", host: "localhost"
2020/11/05 11:43:25 [error] 11479#11479: *43 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status?full&json HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:26 [error] 11479#11479: *46 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?format=plain HTTP/1.1", host: "localhost"
2020/11/05 11:43:26 [error] 11479#11479: *47 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?format=plain HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:26 [error] 11479#11479: *48 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "localhost"
2020/11/05 11:43:26 [error] 11479#11479: *49 open() "/usr/share/nginx/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /server-status?auto HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:27 [error] 11479#11479: *56 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status HTTP/1.1", host: "localhost"
2020/11/05 11:43:27 [error] 11479#11479: *57 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:43:27 [error] 11479#11479: *60 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status?full&json HTTP/1.1", host: "localhost"
2020/11/05 11:43:27 [error] 11479#11479: *61 open() "/usr/share/nginx/html/status" failed (2: No such file or directory), client: 127.0.0.1, server: 127.0.0.1, request: "GET /status?full&json HTTP/1.1", host: "127.0.0.1"
2020/11/05 11:52:24 [error] 31131#31131: *3 user "testuser@mail.kz" was not found in "/etc/nginx/netdata-access", client: 172.21.0.36, server: testnextcloud.nextcloud.kz, request: "GET /netdata/ HTTP/1.1", host: "172.21.0.98"

Сlearing Redis cache, php-fpm didn’t help.

You have some errors that are related to a bug:

For your problem, can you try to load the main page with curl and show the code. Then it shows the redirection. All your access is from localhost, is there another proxy webserver (redirection might be created by it.