Common https http request resource issues

The issue of resources caused by https has been asked many times by colleagues in different positions.

1. The image link fails to load or the resource download fails.

报错信息:Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure image '<URL>'. This request has been blocked; the content must be served over HTTPS.

It means:- "Mixed Content" problem, the http request initiated in the https website is prohibited, this is because chrome has improved the user security policy to protect users from unsafe downloads (click here to view the chrome document Protecting users from insecure downloads)

Note: HTTP protocol requests are not allowed in websites with https protocol

Websites with the http protocol allow access to resources with the https protocol

Second, the general situation is solved in Nginx

In nginx, you can add configuration after server or location

#Solve the situation that https request http resource is unavailable

add_header Content-Security-Policy "upgrade-insecure-requests;connect-src *";

Welcome to criticize and correct~~

Guess you like

Origin blog.csdn.net/qq_35404844/article/details/129553998