Pdf files on same server don't show onebox with subdomain url

I have search in the code,

 def self.external_onebox(url)
Rails.cache.fetch(onebox_cache_key(url), expires_in: 1.day) do
  fd = FinalDestination.new(url, ignore_redirects: ignore_redirects, ignore_hostnames: blacklisted_domains, force_get_hosts: force_get_hosts)
  uri = fd.resolve
  return blank_onebox if uri.blank? || blacklisted_domains.map { |hostname| uri.hostname.match?(hostname) }.any?

  options = {
    cache: {},
    max_width: 695,
    sanitize_config: Sanitize::Config::DISCOURSE_ONEBOX
  }

  options[:cookie] = fd.cookie if fd.cookie

  if Rails.env.development? && SiteSetting.port.to_i > 0
    Onebox.options = { allowed_ports: [80, 443, SiteSetting.port.to_i] }
  end

  r = Onebox.preview(uri.to_s, options)

  { onebox: r.to_s, preview: r&.placeholder_html.to_s }
end

I think the problem is here, no mention for the whitelist ?

return blank_onebox if uri.blank? || blacklisted_domains.map { |hostname| uri.hostname.match?(hostname) }.any?

This link don’t work too, https can be is the problem ?

Thanks,