Failed to register a ServiceWorker

When running Blazor WebAssembly on Apache2 I can't get past this error:

Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The origin of the provided scriptURL ('http://site.com') does not match the current origin ('https://site.com').

Any ideas?