Apache mod-proxy ProxyErrorOverride for specific URL patterns

As arober11 pointed out in the comment above:

Afraid the answer is: No and No. If the directive could be limited to a location, directory, or set of URL's, then there would be something in the "Context" section, of the man page: httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyerroroverride

on the other hand: you can always add it to mod_proxy.c yourself.


For question 2: Definitely doable. Using internal redirects to either new host or port this is possible. Brief outline using hosts (add noErrorOverrideUrl,doErrorOverrideUrl in DNS or /etc/hosts of apache-machine):

NameVirtualHost *:80
<VirtualHost *:80>
   RewriteEngine On
   RewriteRule ^(/noErrorOverrideUrl/.*) http://noErrorOverrideUrl$1 [L,P]
   RewriteRule ^(/doErrorOverrideUrl/.*) http://doErrorOverrideUrl$1 [L,P]          
</VirtualHost>

<VirtualHost *:80>
   ServerName noErrorOverrideUrl
   ProxyErrorOverride Off
   ProxyPass ...
   ...
</VirtualHost>

<VirtualHost *:80>
   ServerName doErrorOverrideUrl
   ProxyErrorOverride On
   ProxyPass ...
   ...
</VirtualHost>

Brief outline using ports:

Listen 80
Listen 81
Listen 82
<VirtualHost *:80>
   RewriteEngine On
   RewriteRule ^(/noErrorOverrideUrl/.*) http://server:81$1 [L,P]
   RewriteRule ^(/doErrorOverrideUrl/.*) http://server:82$1 [L,P]
</VirtualHost>

<VirtualHost *:81>
   ProxyErrorOverride Off
   ProxyPass ...
   ...
</VirtualHost>

<VirtualHost *:82>
   ProxyErrorOverride On
   ProxyPass ...
   ...
</VirtualHost>