Overview
I was running Drupal with HTTPS using Docker + Traefik, as introduced in the following article.
At the time, with Drupal’s default settings, URLs were set with http as shown below.

The problem with this was that, for example, when setting up Google account login as described in the following article, the redirect URL started with http, while the Google Cloud console requires URLs starting with https. This discrepancy caused authentication to fail in some cases.
https://drupalfan.com/【drupal】googleアカウントでログインできるようにする/
This article notes the solution to this problem.
Method
The following article was helpful.
https://www.58bits.com/blog/canonical-urls-https-and-drupal-89-reverse-proxy-settings
By adding the following 3 lines, Drupal internally uses URLs starting with https.
Summary
There may be aspects I haven’t fully considered, but I hope this serves as a helpful reference.