Change address of NC from domain to domain/nextcloud

i need help doing the exact opisite of this post:
https://help.nextcloud.com/t/solved-change-address-of-nc-from-domain-nextcloud-to-just-domain/33044
i have the same setup, here on my configs:

this is my nextcloud config

?php
$CONFIG = array (
‘passwordsalt’ => ‘xxx’,
‘secret’ => ‘xxx’,
‘trusted_domains’ =>
array (
0 => xxx;com’,
1 => ‘xxx;com’,
2 => ‘192.168.1.8’,
),
‘datadirectory’ => ‘/var/www/vhosts/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘14.0.1.1’,
‘overwrite.cli.url’ => ‘httpp://localhost/nextcloud’,
‘dbname’ => ‘nextclouddb’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘nextcloud’,
‘dbpassword’ => ‘xxx’,
‘installed’ => true,
‘instanceid’ => ‘xxx’,
‘enable_previews’ => true,
‘enabledPreviewProviders’ =>
array (
0 => ‘OC\Preview\PNG’,
1 => ‘OC\Preview\JPEG’,
2 => ‘OC\Preview\GIF’,
3 => ‘OC\Preview\BMP’,
4 => ‘OC\Preview\XBitmap’,
5 => ‘OC\Preview\MarkDown’,
6 => ‘OC\Preview\MP3’,
7 => ‘OC\Preview\TXT’,
8 => ‘OC\Preview\Illustrator’,
9 => ‘OC\Preview\Movie’,
10 => ‘OC\Preview\MSOffice2003’,
11 => ‘OC\Preview\MSOffice2007’,
12 => ‘OC\Preview\MSOfficeDoc’,
13 => ‘OC\Preview\OpenDocument’,
14 => ‘OC\Preview\PDF’,
15 => ‘OC\Preview\Photoshop’,
16 => ‘OC\Preview\Postscript’,
17 => ‘OC\Preview\StarOffice’,
18 => ‘OC\Preview\SVG’,
19 => ‘OC\Preview\TIFF’,
20 => ‘OC\Preview\Font’,
),
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘filelocking.enabled’ => true,
‘redis’ =>
array (
‘host’ => ‘/var/run/redis/redis.sock’,
‘port’ => 0,
‘timeout’ => 0,
‘password’ => ‘xxx’,
),
‘memcache.local’ => ‘\OC\Memcache\Redis’,
);

this is my apache nextcloud config:

<VirtualHost *:80>
ServerAdmin “xxx”
DocumentRoot “/var/www/vhosts/nextcloud”
ServerName “xxxcom”
ServerAlias “xxxcom”

Alias /nextcloud "/var/www/vhosts/nextcloud/"

<Directory "/var/www/vhosts/nextcloud/">
    AllowOverride All
    Options -Indexes +FollowSymlinks
    <IfModule mod_dav.c>
        Dav off
    </IfModule>
    SetEnv HOME "/var/www/vhosts/nextcloud"
    SetEnv HTTP_HOME "/var/www/vhosts/nextcloud"
</Directory>
<Directory "/var/www/vhosts/nextcloud/data/">
    Require all denied
</Directory>
<FilesMatch \.php$>
    SetHandler "proxy:unix:/run/php/php7.0-fpm.nextcloud.sock|fcgi://localhost"
</FilesMatch>

RewriteEngine on
RewriteCond %{SERVER_NAME} =xxx.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

im trying to have a page at /var/www/index.html be what the site goes to, and to get to the next cloud it would be accessible via /nextcloud

Should be: 'overwrite.cli.url' = 'https://localhost/nextcloud',
or 'overwrite.cli.url' = 'http://localhost/nextcloud',

What is in the Apache/Nextcloud error log.
What happens if you call the site in browser?

the error log is:

[Tue Oct 09 16:07:10.047049 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00489: Apache/2.4.25 (Debian) configured – resuming normal operations
[Tue Oct 09 16:07:10.047130 2018] [core:notice] [pid 2370:tid 139977457243328] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:07:43.660029 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Oct 09 16:07:43.664689 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00489: Apache/2.4.25 (Debian) configured – resuming normal operations
[Tue Oct 09 16:07:43.664703 2018] [core:notice] [pid 2370:tid 139977457243328] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:08:48.535589 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Oct 09 16:08:48.540426 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00489: Apache/2.4.25 (Debian) configured – resuming normal operations
[Tue Oct 09 16:08:48.540438 2018] [core:notice] [pid 2370:tid 139977457243328] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:09:03.598676 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Oct 09 16:09:03.603467 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00489: Apache/2.4.25 (Debian) configured – resuming normal operations
[Tue Oct 09 16:09:03.603479 2018] [core:notice] [pid 2370:tid 139977457243328] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:09:06.685464 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Oct 09 16:09:06.690159 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00489: Apache/2.4.25 (Debian) configured – resuming normal operations
[Tue Oct 09 16:09:06.690171 2018] [core:notice] [pid 2370:tid 139977457243328] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:09:16.431503 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Oct 09 16:09:16.436097 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00489: Apache/2.4.25 (Debian) configured – resuming normal operations
[Tue Oct 09 16:09:16.436109 2018] [core:notice] [pid 2370:tid 139977457243328] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:09:26.188318 2018] [mpm_event:notice] [pid 2370:tid 139977457243328] AH00491: caught SIGTERM, shutting down
[Tue Oct 09 16:09:32.249485 2018] [mpm_event:notice] [pid 22168:tid 140007512859840] AH00489: Apache/2.4.25 (Debian) configured – resuming normal operations
[Tue Oct 09 16:09:32.249572 2018] [core:notice] [pid 22168:tid 140007512859840] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:09:32.750757 2018] [mpm_event:notice] [pid 22168:tid 140007512859840] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Oct 09 16:09:32.763060 2018] [mpm_event:notice] [pid 22168:tid 140007512859840] AH00489: Apache/2.4.25 (Debian) OpenSSL/1.0.2l configured – resuming normal operations
[Tue Oct 09 16:09:32.763072 2018] [core:notice] [pid 22168:tid 140007512859840] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Oct 09 16:09:33.309106 2018] [mpm_event:notice] [pid 22168:tid 140007512859840] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Oct 09 16:09:33.320560 2018] [mpm_event:notice] [pid 22168:tid 140007512859840] AH00489: Apache/2.4.25 (Debian) OpenSSL/1.0.2l configured – resuming normal operations
[Tue Oct 09 16:09:33.320574 2018] [core:notice] [pid 22168:tid 140007512859840] AH00094: Command line: ‘/usr/sbin/apache2’

and when i navigate to my website at XXX.com nextcloud comes up right away, i need to to be at XXX.com/nextcloud.

i used this script as iv had issues configuring cache on my own:
https://help.nextcloud.com/t/script-for-100-auto-install-on-debian-9-w-apache-and-postgresql/33978

i ended up using another script and switched to ubuntu and this time it made a alias like this:

worked ever since