大网数据广告活动
服务器运维问答

Custom error page apache

· 52CE 我爱测

I'm trying to setup a custom error page (reverse proxy is apache) Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. **Additional…

问题原文

原帖链接 · Sander Böhm · CC BY-SA 4.0

I'm trying to setup a custom error page (reverse proxy is apache)

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

**Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.**

But the error page isn't loaded if I stop my tomcat server for example (503 error)

And I receive the message above not my .HTML message

my config looks like this:

<VirtualHost *:443>
ServerAdmin XXX
ServerName  XXX


# Possible values: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel warn
ErrorLog XXX
CustomLog XXX
DocumentRoot /var/www/html/
ErrorDocument 503 /503.html

<Directory />
    AllowOverride None
    Require all granted
</Directory>

ProxyPreserveHost On
<Location />
    AddDefaultCharset Off
    Require all granted
    ProxyPass ajp://XXX:XXX/ disablereuse=on
</Location>

If I changed the line ErrorDocument to foo instead of /503.html I see foo so it looks like the .HTML isn't loaded by the config? Is there someone who can help me with it?

已采纳解答

原帖链接 · Mircea Vutcovici · CC BY-SA 4.0

Location / it's served by tomcat. This means that /503.html will be proxied via AJP to be processed by tomcat. If tomcat is down also /503.html page will be unavailable. You need to add another Location stanza for error documents.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-03-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。