HTTP请求已被阻止;内容必须通过HTTPS提供

时间:2016-05-03 06:13:13

标签: angularjs web-services .htaccess http https

我在调用通过HTTP托管的Web服务时遇到问题,我从https域调用Web服务。

网络服务&#htaccess

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]

当我尝试呼叫网络时,我在控制台中出现以下错误。

angular.min.js:93 Mixed Content: The page at 'https://www.<my-domain.com>/#/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://<api url goes here>'. This request has been blocked; the content must be served over HTTPS.

注意

Web服务托管在仅限http的aws服务器中。我的网站托管给其他托管服务提供商。

1 个答案:

答案 0 :(得分:5)

您无法从安全(https)来源获取不安全(http)资源。

它被称为混合内容,浏览器出于安全原因阻止它。 (它可能允许像图像这样的被动内容,通常带有警告)

你能做什么:

  • 向网络服务解释https
  • 的优点
  • 代理Web服务的答案 通过您的服务器
相关问题