Support intro
Sorry to hear you’re facing problems
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
Nextcloud version (eg, 20.0.5): 22.0.0.11
Operating system and version (eg, Ubuntu 20.04): TrueNAS-12.0-U2.1
Apache or nginx version (eg, Apache 2.4.25): nginx/1.20.1
PHP version (eg, 7.4): 7.4.21 (cli) (built: Jul 6 2021 01:55:31) ( NTS )
The issue you are facing: No ‘trusted_domains’ is needed for Nextcloud Access when Nextcloud is behind Reverse Proxy (nginx)
Is this the first time you’ve seen this error? (Y/N): Y
Steps to replicate it:
- Add vhost to nginx proxy server
- Comment the line related to ‘trusted_domains’
- Nextcloud will not show any error screen
Hi, everyone. I am new to Nextcloud. Currently I follow Samuel Dowling’s guide with some adjustment to build a Nextcloud server.
https://www.samueldowling.com/2020/07/24/install-nextcloud-on-freenas-iocage-jail-with-hardened-security/
After the build and some testing, I start to put nextcloud behind my nginx proxy server so that I can access nextcloud in Internet.
However, I find that if I add the below code. Some parameters like ‘trusted_domains’ will not work anymore.
I have tried to comment ‘trusted_domains’, and find that Nextcloud works as normal.
In normal operation, the ‘trusted_domains’ should be a must so that the Nextcloud will only operate in ‘trusted_domains’.
/*'trusted_domains' =>
array (
0 => 'mynextcloud.domain',
),*/
'overwrite.cli.url' => 'https://mynextcloud.domain',
'overwritehost' => 'mynextcloud.domain',
'overwriteprotocol' => 'https',
Also, I would like to know if I need to add these codes. In my testing, tese codes have no effect of Nextcloud.
'proxy' => '',
'trusted_proxies' => [''],
Besides, there are warnings in Security & setup warnings:
Your web server is not properly set up to resolve “/.well-known/webfinger”. Further information can be found in the documentation .
Your web server is not properly set up to resolve “/.well-known/nodeinfo”. Further information can be found in the documentation .
Your web server is not properly set up to resolve “/.well-known/caldav”. Further information can be found in the documentation .
Your web server is not properly set up to resolve “/.well-known/carddav”. Further information can be found in the documentation .
Without proxy, I receive these two only, do I need to solve the problems immediately?
Your web server is not properly set up to resolve “/.well-known/webfinger”. Further information can be found in the documentation .
Your web server is not properly set up to resolve “/.well-known/nodeinfo”. Further information can be found in the documentation .
The output of your Nextcloud log in Admin > Logging:
Should be useless, the Logging seems to be about the “Bug in DnsPinMiddleware.php, unable to resolve hostname #27870”
[PHP] Error: Invalid argument supplied for foreach() at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#69
GET /index.phpajax/checksetup
[PHP] Error: count(): Parameter must be an array or an object that implements Countable at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#68
GET /index.phpajax/checksetup
[PHP] Error: dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#66
GET /index.phpajax/checksetup
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => 'instanceid',
'passwordsalt' => 'passwordsalt',
'secret' => 'secret',
/*'trusted_domains' =>
array (
0 => 'mynextcloud.domain',
),*/
'datadirectory' => '/usr/local/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '22.0.0.11',
//'overwrite.cli.url' => 'https://mynextcloud.lan',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:/tmp/mysql.sock',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'ncdbuser',
'dbpassword' => 'ncdbpassword',
'installed' => true,
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
),
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'default_phone_region' => 'HK',
'loglevel' => 2,
'enable_previews' => false,
'overwrite.cli.url' => 'https://mynextcloud.domain',
'overwritehost' => 'mynextcloud.domain',
'overwriteprotocol' => 'https',
'overwritewebroot' => '/'
);
The output of your Apache/nginx/system log in /var/log/____
:
From /var/log/error.log, all error are below line with different time
2021/07/20 13:58:48 [error] 13247#101924: *7955 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')' in /usr/local/www/nextcloud/config/config.php on line 11" while reading response header from upstream, client: myPC.ip, server: nextcloud.lan, request: "GET /ocs/v2.php/apps/serverinfo/api/v1//basicdata?format=json HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.lan"