Author Topic: bugs add addon domain via API  (Read 2881 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
bugs add addon domain via API
« on: August 28, 2020, 01:59:18 AM »
Hi

I have added an addon domain via API.

==========
$params = array(
   'key'    => APIKEY,
   'action' => 'add',
   'user'   => USERNAME,
   'type'   => 'domain',
   'name' => 'DOMAINNAME',
   'path' => '/public_html/DOMAINNAME',
   'autossl' => 0,
);

$options = array(
   CURLOPT_URL            => $endPoint,
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_POST           => 1,
   CURLOPT_SSL_VERIFYHOST => 0,
   CURLOPT_SSL_VERIFYPEER => false,
   CURLOPT_POSTFIELDS     => http_build_query($params),
);

$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
curl_close($ch);
==========

It was executed properly.
But the following lines were put in the nginx virtual host settings and I can't open my domain with my browser.

==========
location / {
    root /public_html/DOMAINNAME;
    expires max;
    try_files $uri @backend;
}
==========

It should be like below, right?

==========
location / {
    root /home/USERNAME/public_html/DOMAINNAME;
    expires max;
    try_files $uri @backend;
}
==========

The root directory was created under /home/USERNAME/public_html/.

Th line "DOMAINNAME USERNAME /home/USERNAME/public_html/DOMAINNAME" is displayed at List Addon Domains (/SESSION/USERNAME/?module=domains), too.

Only virtual host settings is wrong.

I want to know how I can avoid this thing or how I fix this.

Best,
Shuichi MIyahara @JAPAN