【问题标题】:Proxy Url .htaccess代理网址 .htaccess
【发布时间】:2015-09-15 23:18:53
【问题描述】:

我在 Gchrome 控制台中遇到错误

XMLHttpRequest cannot load http://example.com:7070/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access.

我可以访问 http-bind http://example.com:7070/ 下面是我的 .htaccess 文件

RewriteRule http-bind/ http://example.com:7070/

如何解决这个问题?

【问题讨论】:

    标签: apache .htaccess url-rewriting webserver url-redirection


    【解决方案1】:

    您正在尝试做的是反向代理。 http://example.com:7070/ 在技术上是另一个来源,所以它被阻止加载。

    您有几个选择。

    1. 在 apache 配置文件上配置反向代理,
    2. 在 .htaccess 上实现它,如 this
    3. example.com:7070 上实现CORS

    【讨论】:

      猜你喜欢
      • 2012-08-23
      • 2014-07-30
      • 2012-09-15
      • 2014-06-12
      • 2011-11-16
      • 2017-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多