After activating https i get error "untrusted domain"

yes, you have to add your domain to the “trusted_domains”, in config.php

E.g.:

‘trusted_domains’ =>
array (
0 => ‘example.com’,
1 => ‘www.example.com’,
),

https://docs.nextcloud.com/server/18/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=trusted_domains