Nextcloud listens on all domains and subdomains

I currently got Nextcloud installed on my Server and the problem is that currently there is only one ip set for this server yet. This ip is being used for multiple websites but Nextcloud is listening on all subdomains, no matter if they exist or not. After running some debug routines I found out it might be some kind of greedy rewrite condition.

Nextcloud: 13.0
OS: Ubuntu 16.04
PHP: 7
Apache: 2.4
Additional Control Panel: ISPConfig3

I would like to avoid Nextcloud being able to listen on all domains, subdomains and ips. So I am making use of name hosts. The goal is having apache avoid nextcloud to listen on domains and ips it is not supposed to. I am looking for a vhost/apache based solution to avoid nextcloud reacting to all (sub)domains leading to that ip with the untrusted domain site.
Does anyone know how to configure apache2 to lock nextcloud(including rewrites) in its own vhost?

Regards,
thom

I managed to fix the problem. After reading lots of config files I found out the problem were the default vhost. For any weird reason apache had cloud.domain.tld set as default server which lead to redirecting all requests to the cloud.
If someone else has a similar problem maybe try “apachectl -S” for debugging.
Regards,
thom

1 Like