400 Bad Request

I configured new virtual host on my Nginx web-server for Nextcloud on its own subdomain “cloud.mydomain.tld” (I used Nginx-configuration from Nextcloud Administration manual). Then I installed Nextcloud on it using command-line (again, I followed info in Nextcloud Administration Manual). It took a few seconds, and at the end I got message:

Nextcloud was successfully installed

Then I started my web-server and pointed my web-browser to cloud.mydomain.tld but all I got in return was:

400 Bad Request

I also tried to connect to cloud.mydomain.tld/index.html but I got the same reply (btw, address has changed to cloud.mydomain.tld/index.php).

What could be reason for this? When I remove everything from this virtual-host web-directory, and create only index.php with content “<?php phpinfo(); ?>” I get correct response from web-server showing all php-details. So web-server with php-handler is working…

Did you manage to sort it out - I seem to have the exact same issue ?

I had to modify “trusted_domains” in config.php from:

 'trusted_domains' =>
  array (
    0 => 'localhost',
  ),

to

'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'hostname.domain.tld',
  ),

This is mentioned in admin-guide, but only in the section “installation wizard”. I instead followed “installing from command line”, where this info is missing…

thanks for your input - I’m afraid my issue is somewhere else…

Looking into the logs I see

2020/07/13 14:18:27 [error] 14578#14578: *407 open() "/var/services/web/nextcloud/index.php/login" failed (20: Not a directory), client: x.x.54.25, server: , request: "GET /nextcloud/index.php/login HTTP/1.1", host: "device.domain.tld"
2020/07/13 14:18:27 [error] 14578#14578: *409 open() "/var/services/web/missing" failed (2: No such file or directory), client: x.x.54.25, server: , request: "GET /missing HTTP/1.1", host: "device.domain.tld", referrer: "http://device.domain.tld/nextcloud/index.php/login"

There is an “index.php” in /var/services/web/nextcloud but it is a file, not a directory… Not sure what’s going on here ?