首页 / 浏览问题 / 云GIS / 问题详情
超图FAQ:请问iServer出现跨域怎么解决呢,未使用Nginx,已设置白名单
44,106EXP 2024年04月15日

请问iServer出现跨域怎么解决呢,未使用Nginx,已设置白名单

1个回答

【问题原因】在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; } }
44,106EXP 2024年04月15日
热门文章
关注我们
...