从不同域访问 bugzilla Web 服务的好方法是什么?
我有两个网站 products.company.com
和 bugzilla.internal.com
。我想从 products.company.com 页面访问错误信息。我设置了一个 jQuery ajax 函数来对 bugzilla.internal.com/jsonrpc.cgi
进行 jsonrpc 调用。然而,由于跨域脚本限制,这被 apache 阻止了(正如预期的那样)。然后我将ajax发送到products.company.com上的cgi脚本,然后在该脚本中使用curl来发送对bugzilla.internal.com/jsonrpc.cgi
的请求,但现在它说
您无权访问 /jsonrpc.cgi
该怎么办?
如果它使任务更简单,我只想使用 获取 bug 功能。
I have two sites products.company.com
and bugzilla.internal.com
. I would like to access bug information from the products.company.com page. I set up a jQuery ajax function to make a jsonrpc call to bugzilla.internal.com/jsonrpc.cgi
. However due to cross domain scripting restrictions, this was blocked by apache (as expected). So then I shot the ajax to a cgi script on products.company.com and then used curl in that script to shoot off the request to bugzilla.internal.com/jsonrpc.cgi
, but now it says
You don't have permission to access
/jsonrpc.cgi
What to do?
if it makes the task any simpler, I only want to use the get bug feature.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果 products.company.com 上的 Web 服务器是 Apache,则可以设置 ProxyPass。
如果您无法修改 Web 服务器配置,那么 products.company.com 上的简单代理 cgi 就可以解决问题:
If your web server at products.company.com is Apache, you can set up a ProxyPass.
If you can't modify web server configuration, then a simple proxy cgi at products.company.com can do the trick:
你有几个选择。您可以让
products.company.com
向bugzilla.internal.com
发出请求,并让它基本上充当代理。另一种选择是使用客户端的 jsonp - 这将允许跨域调用。 这是一篇关于 jsonp 入门的非常好的 IBM 文章。
You have a couple options. You can have
products.company.com
make the request tobugzilla.internal.com
and have it basically act as a proxy.Another option would be to use jsonp from the client - this will allow for cross domain calls. Here's a pretty good IBM article on getting started with jsonp.
有多种解决跨域脚本限制的方法。我还没有测试过,但是 easyXDM 似乎可以做你想做的事情。
There are several work arounds for cross domain scripting restrictions. I haven't tested it, but easyXDM seems to do what you want.