For the purposes of Nextcloud, I just added the following line in .httpaccess of the directory:
Header always set Strict-Transport-Security "max-age=15768000" env=HTTPS
as mentioned here: ServerPilot | How to Enable HTTP Strict Transport Security (HSTS)
It seems to eliminate the error. Is...