nginx: 当HTTPS资源引入HTTP导致报错blocked:mixed-content (混合加载/Mixed Content)如何解决

location /
{
expires 12h;
if ($request_uri ~* "(php|jsp|cgi|asp|aspx)")
{
expires 0;
}
proxy_pass http://127.0.0.1:8181;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;

add_header Cache-Control no-cache;
add_header X-Cache $upstream_cache_status;
add_header Content-Security-Policy "upgrade-insecure-requests;";

proxy_set_header Accept-Encoding "";

sub_filter_once off;

#开启缓存
#proxy_cache cache_one;
#proxy_cache_key $host$uri$is_args$args;
#proxy_cache_valid 200 304 301 302 12h;
}

posted @ 2024-02-05 21:54  China Soft  阅读(463)  评论(0编辑  收藏  举报