You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever a redirect happens, like from the /apps/ to the /apps/files/ path, NextCloud now redirects using the server provided hostname and port instead of the one requested by the client.
For instance, if running via Docker on localhost:8000 and using a proxy pass with cloud.example.com, the address cloud.example.com/apps/ will redirect to localhost:8000/apps/files/.
This happens with the / to /login redirect as well, so this bug completely prevents access to the instance from the web interface, unless you manually correct the URL afterwards.
Same problem and same setup:
Apache Proxy -> Docker -> Nexcloud and always redirecting to https://127.0.0.1:8080/login. With 15.0 it worked fine, update to 15.0.2 broke
Provided links did not help.
What helped is changing: 'overwrite.cli.url' => 'https://XXXX.de',
to 'overwritehost' => 'XXXX.de', 'overwriteprotocol' => 'https',
It seems for me 'overwrite.cli.url' in config.php is broken
Reacted by Marcus Thormählen, Simon Schürg, lachlan, Worble, K. Shankari, Lars Becker, Austin Jackson, am97, Mark Hepburn, OstrichBot and 20 more
The main issue was, that in 15.0.0 only having 'overwrite.cli.url' and 'overwriteprotocol' was sufficient for Nextcloud. It seems, that for 15.0.2 'overwritehost' is necessary. At least in docker version with Apache-Proxy. I have readded 'overwrite.cli.url', too. So my config looks like this now and is working perfectly:
The main issue was, that in 15.0.0 only having 'overwrite.cli.url' and 'overwriteprotocol' was sufficient for Nextcloud. It seems, that for 15.0.2 'overwritehost' is necessary.
Thank you for pointing this out 👍
@MorrisJobke@rullzer@J0WI they were many reports within the last days about this. I suppose this is related to #13116 because the docker network is not trusted by default. In this case HTTP_FORWARDED_HOST is not longer trusted. What do you suggest? Is it possible to add this for the official docker image? 🏓
CIDR is possible for trusted_network since nextcloud 15. Something like 172.0.0.0/8 as trusted proxy would work (not sure if docker uses 172.x all the time).
@kyrofa@enoch85 (not sure if snap or vm is running into the same. just in case)
Nextcloud 15.0.0: Nextcloud accept HTTP_FORWARDED_HOST from Nginx (or any other proxy).
Nextcloud 15.0.2: Nextcloud does not accept HTTP_FORWARDED_HOST from Nginx (or any other proxy).
In #13116 we did some security hardening (trust HTTP_FORWARDED_HOST only if proxy is trusted proxy). Nextcloud behind nginx worked well for most people without setting overwritehost. @J0WI do you think we could set trusted_network to 172.0.0.0/8 by default (and make it configurable) for the docker image?
172.0.0.0/8 would be a bad idea, only 172.16.0.0/12 is private. If we trust them by default, we should probably trust all RFC 1918 (and RFC 4193?) networks?
However, you can use any other IP for Docker, so I think we need nextcloud/docker#527 anyway.
If you run nextcloud behind a reverse proxy usually some headers (like X-Forwarded-For) are present. You should see a setup warning (nextcloud 16) for such cases: #14261
To be done: A warning if some required parameters not present (e.g. apache2 does not forward x-forwarded-proto while nginx and traefik does => overwriteproto is required for apache2).
The main issue was, that in 15.0.0 only having 'overwrite.cli.url' and 'overwriteprotocol' was sufficient for Nextcloud. It seems, that for 15.0.2 'overwritehost' is necessary. At least in docker version with Apache-Proxy. I have readded 'overwrite.cli.url', too. So my config looks like this now and is working perfectly:
hi. I'm just starting to learn Linux. I have NextCloud 30.0.1 set up at home on Debian 12.7. I am also being redirected to a local IP... I use DDNS on the router for access.
made the following changes:
'overwritehost' => 'XXX.link', 'overwriteprotocol' => 'https', 'overwrite.cli.url' => 'https://XXX.link ',
the error persists (((
masters - I ask for help
p.s. I checked with a static ip address on the router. with forwarding to NextCloud. Error.... redirects to the local IP (((((
Experiencing the same issue with version 30. Tried setting the overwrites as mentioned above but no luck. This makes it impossible to login in Android because when you try to grant access to the device it goes to 127.0.0.1:8080/login/flow which produces an ERR_CONNECTION_REFUSED error
Activity
mrzapp commentedon Jan 21, 2019
Related to #13710
RandomMetalhead commentedon Jan 21, 2019
Same problem and same setup:
Apache Proxy -> Docker -> Nexcloud and always redirecting to https://127.0.0.1:8080/login. With 15.0 it worked fine, update to 15.0.2 broke
kesselb commentedon Jan 21, 2019
Does this help? https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/reverse_proxy_configuration.html
If not please provide the information from the issue template (https://github.com/nextcloud/server/blob/master/.github/ISSUE_TEMPLATE/Bug_report.md).
RandomMetalhead commentedon Jan 21, 2019
Provided links did not help.
What helped is changing:
'overwrite.cli.url' => 'https://XXXX.de',to
'overwritehost' => 'XXXX.de', 'overwriteprotocol' => 'https',It seems for me 'overwrite.cli.url' in config.php is broken
mrzapp commentedon Jan 21, 2019
Yep, @RandomMetalhead's solution works
kesselb commentedon Jan 21, 2019
Great 🎉
I guess we could improve the documentation here. It's not obvious that the bold text are configuration parameters.
@RandomMetalhead you also need
overwrite.cli.url(https://github.com/nextcloud/server/blob/stable15/config/config.sample.php#L477-L485)RandomMetalhead commentedon Jan 21, 2019
The main issue was, that in 15.0.0 only having 'overwrite.cli.url' and 'overwriteprotocol' was sufficient for Nextcloud. It seems, that for 15.0.2 'overwritehost' is necessary. At least in docker version with Apache-Proxy. I have readded 'overwrite.cli.url', too. So my config looks like this now and is working perfectly:
'overwritehost' => 'XXX.de', 'overwriteprotocol' => 'https', 'overwrite.cli.url' => 'https://XXX.de',kesselb commentedon Jan 21, 2019
Thank you for pointing this out 👍
@MorrisJobke @rullzer @J0WI they were many reports within the last days about this. I suppose this is related to #13116 because the docker network is not trusted by default. In this case
HTTP_FORWARDED_HOSTis not longer trusted. What do you suggest? Is it possible to add this for the official docker image? 🏓kesselb commentedon Jan 21, 2019
CIDR is possible for
trusted_networksince nextcloud 15. Something like172.0.0.0/8as trusted proxy would work (not sure if docker uses 172.x all the time).@kyrofa @enoch85 (not sure if snap or vm is running into the same. just in case)
enoch85 commentedon Jan 21, 2019
Thanks for the heads up @danielkesselberg Nothing reported, and nothing I've experienced myself.
J0WI commentedon Jan 21, 2019
See also nextcloud/docker#527
kesselb commentedon Jan 22, 2019
nextcloud/docker#527 makes it easier to configure these parameters 👍
HTTP_FORWARDED_HOSTfrom Nginx (or any other proxy).HTTP_FORWARDED_HOSTfrom Nginx (or any other proxy).In #13116 we did some security hardening (trust
HTTP_FORWARDED_HOSTonly if proxy is trusted proxy). Nextcloud behind nginx worked well for most people without settingoverwritehost. @J0WI do you think we could settrusted_networkto172.0.0.0/8by default (and make it configurable) for the docker image?J0WI commentedon Jan 22, 2019
172.0.0.0/8would be a bad idea, only172.16.0.0/12is private. If we trust them by default, we should probably trust all RFC 1918 (and RFC 4193?) networks?However, you can use any other IP for Docker, so I think we need nextcloud/docker#527 anyway.
neeral85 commentedon Jan 23, 2019
I'm running https://www.hanssonit.se/nextcloud-vm/
my ip is 172.18.1.10 and
'overwritehost' => 'XXX.de', 'overwriteprotocol' => 'https', 'overwrite.cli.url' => 'https://XXX.de',
was not working for me.
enoch85 commentedon Jan 23, 2019
@neeral85 So you have issues on the Nextcloud VM as described in this issue?
9 remaining items
kesselb commentedon Apr 2, 2019
If you run nextcloud behind a reverse proxy usually some headers (like X-Forwarded-For) are present. You should see a setup warning (nextcloud 16) for such cases: #14261
kesselb commentedon Apr 2, 2019
To be done: A warning if some required parameters not present (e.g. apache2 does not forward x-forwarded-proto while nginx and traefik does => overwriteproto is required for apache2).
MorrisJobke commentedon May 7, 2019
Fix is in #15430
Darkless012 commentedon Jan 29, 2024
I'm running Nextcloud 25 and the login issue redirect was appearing.
Fixed by adding overwritehost and overwriteprotocol into config.php
Shame that config is JSON, because you can't use simple Ansible to manage line in file.
a214218 commentedon Oct 24, 2024
hi. I'm just starting to learn Linux. I have NextCloud 30.0.1 set up at home on Debian 12.7. I am also being redirected to a local IP... I use DDNS on the router for access.
made the following changes:
'overwritehost' => 'XXX.link', 'overwriteprotocol' => 'https', 'overwrite.cli.url' => 'https://XXX.link ',
the error persists (((
masters - I ask for help
p.s. I checked with a static ip address on the router. with forwarding to NextCloud. Error.... redirects to the local IP (((((
elclanrs commentedon Dec 13, 2024
Experiencing the same issue with version 30. Tried setting the overwrites as mentioned above but no luck. This makes it impossible to login in Android because when you try to grant access to the device it goes to 127.0.0.1:8080/login/flow which produces an ERR_CONNECTION_REFUSED error