Table of Contents
FastAPI (gunicorn) bị lỗi Mixed Content HTTPS vs HTTP
Nhận dạng lỗi
Mixed Content: The page at 'https://aaaa' was loaded over HTTPS, but requested an insecure stylesheet 'http://aaaa/static/dist/css/bootstrap.min.css'. This request has been blocked; the content must be served over HTTPS.
Cách sửa FastAPI (gunicorn) bị lỗi Mixed Content HTTPS vs HTTP
Bổ sung thẻ <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
vào file template html của bạn
Another workaround is to add:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
to index.html
file in frontend. It will upgrade all requests from http
to https
(also when run locally, so it may not be the best workaround)