Request failed: bad request (400)


I have nextcloud in a snap with 13.0.5 Build:2018-08-07T23:01:23+00:00 f6c8668a7e230066feff98ee58c8405f70ba94f7
in use and everything was fine.
Now if I want to connect with my iphone to the nextcloud server (via nextcloud app and internet, not in the same network) I get the error
Connecting not possible. Request failed: bad request (400) .
I checked my router, trusted domains an the port nextcloud is listening. Everything ok.
If I want to connect in the same nework, internal 192.x.x.xx, it works fine.

someone an idea
thank you

I get a similar error (400) via my iPhone app OR Safari on the iPhone. It doesn’t even give an error for Safari, just dumps me back to the login window to try anew.

My iPad Pro NextCloud app works, Safari does not.

Both are on the same iOS version,

I’m a me too. The Nextcloud app does not connect if connecting via domain name and presents the 400 error, but I can connect via IP address

1 Like

Solved. You have to set the trusted domains using the occ command line tool ( I think you can select this during installation, but I didn’t).

In my case this was in docker so it was a bit different.

docker exec -it nextcloud /bin/bash to access the nextcloud docker console

find /config -iname occ ) #replace config with www in some cases I believe (this is just to find where the occ executable is as it won’t run if you’re not in it’s directory.

ls -la (note the username of the files (mine was abc, some are apparently www-data or Nginx)

sudo -u abc php occ config:system:get trusted_domains (replace abc with your user)

sudo -u abc php occ config:system:set trusted_domains 2 --value=yourowncloud.yourdomain

Thats it all done.