apache SSLオフロード rewrite

ServerName https://example.com

ServerName accepts a scheme as well, e.g. ServerName https://example.com. Changing this in the configuration and restarting Apache did the trick.
From the documentation:
Sometimes, the server runs behind a device that processes SSL, such as a reverse proxy, load balancer or SSL offload appliance. When this is the case, specify the https:// scheme and the port number to which the clients connect in the ServerName directive to make sure that the server generates the correct self-referential URLs.

https://serverfault.com/questions/746875/how-to-make-apache-s-mod-rewrite-redirect-over-https-by-default

SSL を処理するデバイス、例えばリバースプロクシやロードバランサや SSL 処理軽減アプライアンスの裏側でサーバが稼動する場合もあるでしょう。 そういった場合では、クライアントが接続するときに使う https:// スキームとポート番号を ServerName ディレクティブで指定して、自己参照 URL が正しく生成できるようにします。

https://httpd.apache.org/docs/2.4/mod/core.html#servername