I have apache configured as reverse proxy to liferay tomcat, 5 virtual hosts are configured on liferay tomcat, below configuration is used to serve error pages from apache.
Alias /error/ "/usr/share/apache2/error/"
Options -Indexes
ProxyPassMatch /error/(403|5xx) !
ProxyErrorOverride On
ErrorDocument 500 /error/5xx/500.html
ErrorDocument 403 /error/403/403.html
Problem is 404 hits are also being served by apache because of ProxyErrorOverride, is there a way I can bypass 404 so that will be served from backend server ?
This way I can have separate 404 pages for different virtual hosts. Since virtual hosts are not configured on apache, I cant tell apache to serve different error pages for different site.
I want to keep serving 403 and 500 from apache so ProxyErrorOverride cant be Off.
You can have multiple virtual hosts on Apache. Just point them all to the same app server and make sure that you preserve host.
Then you can make the configuration per virtual host on the app server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With