Ove*_*low 8 reverse-proxy apache-2.2
我使用 Apache2 作为 tomcat 的反向代理,我的配置类似于:
ProxyRequests Off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
Run Code Online (Sandbox Code Playgroud)
我的问题是:我可以配置 Apache 以在 Tomcat 关闭时显示礼貌页面(“正在建设中”的 HTML 静态页面)吗?
use*_*517 13
您可以使用 Apache ErrorDocument指令来执行此操作。您应该使用 URL 指向您的 ErrorDocument 否则,如果您使用文件系统引用,您将在尝试找到它时获得额外的 503。
ErrorDocument 503 http://somehost.tld/errors/503.html
Run Code Online (Sandbox Code Playgroud)
小智 5
这是没有额外服务器或其他端口的解决方案:
ProxyPass /http_errors/ !
#Actual proxy config, must be below exception!
ProxyPass / ajp://myserver:12345/
Alias /http_errors/ /var/www/http/
ErrorDocument 503 /http_errors/503.html
Run Code Online (Sandbox Code Playgroud)
简而言之:
所以对于上面的设置,出现问题时显示的文件是/var/www/http/503.html。
| 归档时间: |
|
| 查看次数: |
26913 次 |
| 最近记录: |