gpt4 book ai didi

jquery - nginx 代理从 https 到 http 获取阻止加载混合事件内容错误

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:28:02 28 4
gpt4 key购买 nike

我正在使用 nginx (openresty) 并尝试使用 https 设置从公共(public) wan 到使用 http 的私有(private) 10 网络上的 apache 服务器的代理。我尝试代理的应用程序是 openscrum。页面加载但一些 javascript(jquery 和更多)试图通过 http 而不是 https。使用 Firebug 我看到这些错误:

Blocked loading mixed active content "http://privateurl.com/js/jquery-ui-1.9.2.custom.min.js"

我不知道解决方案是什么,这是我用于 nginx 虚拟主机的解决方案:

upstream SVRLINK {
server 10.100.200.25;
}
server {
listen 80;
server_name mgt.privateurl.com.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl;
server_name mgt.privateurl.com.com;

ssl on;
ssl_certificate /opt/services/configs/mgt/cert.pem;
ssl_certificate_key /opt/services/configs/mgt/key.pem;
ssl_client_certificate /opt/services/certs/public_certs/mychain.pem;
ssl_verify_depth 5;
# ssl_verify_client on;

ssl_prefer_server_ciphers on;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
client_max_body_size 20m;
error_log /etc/openresty/nginx/logs/error debug;
access_log /etc/openresty/nginx/logs/access;

location / {
proxy_read_timeout 300;
proxy_connect_timeout 300;
# proxy_redirect off;

proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://SVRLINK;
proxy_redirect http:// https://;
}
}

关于我可以做些什么来让它工作有什么想法吗?感谢您抽出宝贵时间。

-稳定

最佳答案

我可能迟到了将近五年,但我最近遇到了这个问题,对我来说,解决方案是在 HTML 页面中设置:

<base href="/" />

在 nginx 中设置以下内容:

proxy_set_header   X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://your_server_host:your_server_port;

关于jquery - nginx 代理从 https 到 http 获取阻止加载混合事件内容错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33404974/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com