I have an Apache server that has /
forwarding to a Tomcat server. When the Tomcat server is down, I want to display an error message. Here's what I have currently:
ErrorDocument 502 "We're down, sorry :("
I would like to show a relatively rich document (funny picture and stuffs), not just a one sentence message. The issue is, it doesn't appear I can serve documents, only redirect to them. I'm looking at this documentation.
I'd like to keep the same URL, but serve a different HTML file. Any way to do this?
<VirtualHost *:443>
ServerName ${DOMAIN_NAME}
ProxyRequests Off
ProxyAddHeaders On
ProxyPass /stomp http://tomcat:8080/stomp
ProxyPassReverse /stomp http://tomcat:8080/stomp
ProxyPass /.well-known http://mail.${DOMAIN_NAME}:80/.well-known
ProxyPassReverse /.well-known http://mail.${DOMAIN_NAME}:80/.well-known
ProxyPassMatch / http://tomcat:8080 retry=0 timeout=10
ProxyPassReverse / http://tomcat:8080
SSLCertificateFile /etc/letsencrypt/live/${DOMAIN_NAME}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/${DOMAIN_NAME}/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ErrorDocument 502 ${PROXY_ERROR_MESSAGE}
ErrorDocument 503 ${PROXY_ERROR_MESSAGE}
</VirtualHost>