Both file and source are serve as HTTPS but Mixed Content problem still appear

Problem: “…was redirected through an insecure connection. This file should be served over HTTPS…” occurred. But both website and file are all https.

Solution: in header tag add below code to make insecure connection turn to HTTPS automatically.

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

You may also like...