Apache Mod-跨域重写?
好的,我有一个网站,位于 www.domain.com。我在 heroku 上添加了一个 Web 应用程序,它有 Heroku URL 和自定义域。然而,我想做的是通过这两个 URL 访问它,但在 www.domain.com 站点上,我想通过 www.domain.com/customapp 访问该新服务器。我想我可以通过 URL 重写来做到这一点。但我看到的所有例子都是相反的,那么我的想法可能吗? mod-rewrite 是正确的出路吗?
谢谢。
OK, I have a site, at www.domain.com. I added a web app on heroku and it has it Heroku URL and a custom domain. However, what I'd like to do is have it accessible via those two URL but on the www.domain.com site, I'd like to access that new server via www.domain.com/customapp. I figured I could do it through URL rewrite. But all the examples I see are doing the the other way, so is my idea possible? Is mod-rewrite the way to go?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不尝试为 www.domain.com 设置反向代理?假设您使用的是 Apache 2.2,如果您有权访问 httpd.conf 或 httpd-vhosts.conf 文件,那么这很容易做到。
对于您的情况,我会将以下内容添加到您的 httpd.conf 或 httpd-vhosts.conf 文件中。
有关更多信息,请参阅文档。
http://httpd.apache.org/docs/2.2/mod/mod_proxy .html#proxypassreverse
Why don't you try setting up a reverse proxy for www.domain.com? Assuming you are using Apache 2.2, it's pretty easy to do if you have access to the httpd.conf or httpd-vhosts.conf file.
In your case I would add the following to your httpd.conf or httpd-vhosts.conf file.
For more information, see the docs.
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse