Apache 将除 Webmail 之外的所有内容转发到 Tomcat

发布于 2024-09-16 18:52:02 字数 280 浏览 4 评论 0原文

我将我的 Apache HTTP 服务器设置为将所有请求转发到 Tomcat,即 proxy_ajp.conf 如下所示:

ProxyPass / ajp://localhost:8009/

Tomcat 正在侦听端口 8009。除了当我尝试访问服务器上的 squirrelmail(即 webmail)时,这可以正常工作。有没有办法将所有请求转发到 Tomcat 除了那些发送到 /webmail/ 的请求?

感谢您的帮助。

I have my Apache HTTP server set up to forward all requests to Tomcat, i.e. proxy_ajp.conf looks like:

ProxyPass / ajp://localhost:8009/

where Tomcat is listening on port 8009. This works find except when I try to access squirrelmail (i.e. webmail) on the server. Is there a way to forward all requests to Tomcat except those going to /webmail/?

Thanks for the help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼藏柔 2024-09-23 18:52:02

这实际上更像是一个服务器故障问题,但是是的,你可以做到。

您需要使用 RewriteRule,如下所示:

RewriteEngine On
RewriteCond REQUEST_URI !^/webmail.*
RewriteRule / /tomcat/

<Location /tomcat>
     ProxyPass ajp://localhost:8099/
</Location>

This is really more of a serverfault sort of a question, but yes, you can do it.

You need to use a RewriteRule, something like this:

RewriteEngine On
RewriteCond REQUEST_URI !^/webmail.*
RewriteRule / /tomcat/

<Location /tomcat>
     ProxyPass ajp://localhost:8099/
</Location>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文