Nextcloud cannot connect to S3 objectstore

the url to the S3 object store service is wrongly formed:
A part in the log is shown as follows:
"message":"Error executing \"PutObject\" on \"\"; AWS HTTP error: cURL error 6:
The URL has the bucketname as part of hostname and as well as a subdirecory name:

the array var
'use_path_style' => true or 'use_path_style' => false
in the config.php file has no effect.

Part of config file related to the objectstore is:

$CONFIG = array (
  'objectstore' => 
  array (
    'class' => 'OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => 'nextcloud-data',
      'key' => '** sensitive data removed **',
      'secret' => '** sensitive data removed **',
      'hostname' => '',
      'use_path_style' => true,

In an edit changed config.php to minimum required
10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
php 8.1
VPS service by

The error is my own mistake.
As preparation of a new install you have to create an storage.config.php file.
I wrongly assumed that part of the hostname was the bucketname

The wrong line was:
'hostname' => '',
However this should be without bucketname
'hostname' => '',