gpt4 book ai didi

apache - 使用 Apache 作为代理服务器 + Tomcat

转载 作者:行者123 更新时间:2023-11-28 23:41:22 26 4
gpt4 key购买 nike

我正在尝试在 tomcat 关闭时显示自定义页面,为了做到这一点,我使用了 apache 服务器。我正在尝试将所有请求重定向到 tomcat (localhost:8080),但以“/error”开头的请求除外,我该怎么做?我在 httpd.conf 文件中尝试过这样的事情:

ErrorDocument 503 /error/503.html

<IfModule proxy_http_module>

ProxyPass /error http://localhost/ retry=0
ProxyPassReverse /error http://localhost/

ProxyPass / http://localhost:8080/ retry=0
ProxyPassReverse / http://localhost:8080/

</IfModule>

但是没有成功。

最佳答案

在问你的问题之前,你有没有看过 ProxyPass 的 httpd 文档?

你想要

ProxyPass /error !

排除以/error开头的路径

关于apache - 使用 Apache 作为代理服务器 + Tomcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19221402/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com