尝试使用 Apache httpd 进行反向代理。无法让 URL 重写工作
我的 Sventon 在 Apache Tomcat 下的服务器端口 8090 上运行。我还在该服务器上运行 Apache httpd,并且我希望用户输入:
http://myserver.com/repos
To get to Sventon 而不是:
http://myserver.com:8090/svn
我尝试设置 ReverseProxy,并且大部分成功。输入:
http://myserver.com/repos
让您进入 Sventon,但浏览器中的 URL 更改为:
http://myserver:8090/svn
我想隐藏 URL 中的更改,并且我有以下配置:
ProxyRequests off
ProxyPass /repos http://myserver.company.com:8090/svn
#ProxyPassReverse /repos http://myserver.company.com:8090/svn
<Location /repos>
ProxyPassReverse /
SetOutputFilter proxy-html
# ProxyHTMLInterp On
ProxyHTMLURLMap / /repos
RequestHeader unset Accept-Encoding
</Location>
这可能看起来很小,但我们计划对所有我们的其他系统。我们正在运行 Jira、Confluence、Jenkins 等。有些在这个系统上,有些在其他系统上。我想对其进行设置,以便我有一组简单的 URL:
http://myserver.company.com/issues
http://myserver.company.com/wiki
http://myserver.company.com/builds
http://myserver.company.com/repos
而不是这样的东西:
http://anotherserver.company.com:8090/jira
http://asecondserver.company.com:8999/confluence
http://asecondserver.company.com:8080/
http://myserver.company.com/8090/svn
正如我所说,ReverseProxy 似乎正在工作。它确实会转到另一个 URL,但它会更改浏览器中的 URL(我们要隐藏该 URL)。
知道我做错了什么吗?
I have Sventon running on port 8090 of my server under Apache Tomcat. I also have Apache httpd running on this server, and I'd like to have users type in:
http://myserver.com/repos
To get to Sventon instead of:
http://myserver.com:8090/svn
I've tried to setup a ReverseProxy and mostly successful. Typing in:
http://myserver.com/repos
Gets you to Sventon, but the URL in the browser changes to:
http://myserver:8090/svn
I'd like to hide the change in the URL, and I have the following configuration:
ProxyRequests off
ProxyPass /repos http://myserver.company.com:8090/svn
#ProxyPassReverse /repos http://myserver.company.com:8090/svn
<Location /repos>
ProxyPassReverse /
SetOutputFilter proxy-html
# ProxyHTMLInterp On
ProxyHTMLURLMap / /repos
RequestHeader unset Accept-Encoding
</Location>
This might seem minor, but we plan to do this with all of our other systems. We're running Jira, Confluence, Jenkins, etc. Some on this system, and some on other systems. I'd like to get it setup, so that I have simple set of URLs:
http://myserver.company.com/issues
http://myserver.company.com/wiki
http://myserver.company.com/builds
http://myserver.company.com/repos
Instead of something like this:
http://anotherserver.company.com:8090/jira
http://asecondserver.company.com:8999/confluence
http://asecondserver.company.com:8080/
http://myserver.company.com/8090/svn
As I said, the ReverseProxy seems to be working. It does go to the other URL, but it changes the URL in the browser (which we want to hide).
Any idea what I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅此处:
https://groups.google.com/d/topic/ sventon-support/TmfiJPvF95s/discussion
http://wiki.sventon.org/index.php?n=Main.OptionalVariables
See here:
https://groups.google.com/d/topic/sventon-support/TmfiJPvF95s/discussion
http://wiki.sventon.org/index.php?n=Main.OptionalVariables