【发布时间】:2019-11-19 19:37:07
【问题描述】:
我正在尝试在 Apache 上设置自定义 403 和 404 错误页面。
Server config is as follows:
Server version: Apache/2.4.29 (Ubuntu)
Server built: 2019-04-03T13:22:37
Ubuntu 18.04.2 LTS
我使用 Apache 做 AJP 反向代理,如下:
ProxyVia On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /app ajp://localhost:8009/share
ProxyPassReverse /app ajp://localhost:8009/share
我的 ErrorDocument 代码如下:
ErrorDocument 404 /cah-404.html
ErrorDocument 403 /cah-403.html
现在,如果我通过浏览器访问上述应用程序,例如“https://server.xyz/app”,我会收到如下消息:
Forbidden
You don't have permission to access /app/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.4.29 (Ubuntu) Server at server.xyz Port 443
我的自定义错误页面位于 /var/www/html 这些页面的权限是 444
任何想法为什么会发生此错误? 我正在尝试从未经授权的 ISP 访问该页面。所以 Forbidden 显示很好 - 但它应该显示自定义禁止页面。
【问题讨论】:
标签: apache tomcat reverse-proxy ajp