【问题原因】在H5页面使用了https和http协议混合使用
【解决办法】可以使用Nginx工具代理iServer的http协议为https,Nginx实现具体配置参考如下,其中HTTPS的证书生成可以参考博客https://blog.csdn.net/weixin_42414681/article/details/135346685
# HTTPS server
#
server {
listen 8880 ssl;
server_name localhost,127.0.0.1,172.16.13.121;
ssl_certificate ./ssl/server.crt;
ssl_certificate_key ./ssl/server.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10240M;
client_body_buffer_size 1024;
location / {
proxy_set_header Accept-Encoding "";
subs_filter_types *;
subs_filter 'http://172.16.13.121:8090/iserver' 'https://172.16.13.121:8880/iserver';
proxy_pass http://172.16.13.121:8090;
}
location ~ .*.(js|css|jpg|png)$ {
subs_filter_types *;
subs_filter 'http://172.16.13.121:8090/iserver' 'https://172.16.13.121:8880/iserver';
proxy_pass http://172.16.13.121:8090;
}
location ~ .svg$ {
default_type image/svg+xml;
proxy_set_header Content-Type "image/svg+xml";
proxy_pass http://172.16.13.121:8090;
}
}