尝试使用 Apache httpd 进行反向代理。无法让 URL 重写工作

发布于 2024-11-29 01:49:54 字数 1441 浏览 1 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文