Change Nextcloud - URL from domain/... to domain/nextcloud/

Hey guys,

at the moment I am running Nextcloud on an ubuntu server with docker-compose.
Acctually the directory is set by default (I think), domain/ now I want to change my url to domain/nextcloud/ for management reasons.
I heard some people are doing it with their reverse proxys, other are just changing their config.php like this: 'htaccess.RewriteBase' => '/nextcloud',.

What is the best way to do it?

Thanks.