Some HTTP links not rewritten to HTTPS despite `'overwriteprotocol' => 'https'`

I use Apache and rewrite to https:// rule I have on my :80 instance is

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !^/.well-known
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,NE,R=permanent,L]

config.php

  'datadirectory' => '/var/www/domains/mydom.net/htdocs/nextcloud/data',
  'overwrite.cli.url' => 'https://mydom.net/',
  'htaccess.RewriteBase' => '/',
  'dbtype' => 'mysql',
  'version' => '19.0.0.12',