网站挂到阿里云上, 可以http访问, 也可以https访问。

但是如果用https方式访问网站。发现接口报错。 因为接口只提供http方式。

 

在谷歌浏览器出现:

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

 

在Safari浏览器出现:

XMLHttpRequest cannot load http://x x xxxx:18080/gate due to access control checks.

Not allowed to request resource

 

提供接口的服务器是允许跨域请求的。还是出现这样的错误。

通过设置代理,查看请求,发现压根就没有走网络,直接被浏览器拦截了。

浏览器发现走的http协议,直接被干掉了。

 

出现这种情况, 只能升级接口,让接口支持https