PDA

View Full Version : ProxyPassMatch directive problems


testius
07-29-2009, 01:38 AM
We have an environment with Apache 2.2.11 acting as front end to incoming connections to a Tomcat backend server. We are using the following directives in the http-ssl.conf, which works great when not trying to catch 403 errors:

SetEnvIf COMPANY EDLP 4.0.1 NLEDLPKEY=true
<VirtualHost _default_:443>

# General setup for the virtual host
DocumentRoot "C:/xampp/htdocs/"

ServerName localhost:443
ServerAdmin admin@localhost

ProxyRequests Off

ProxyPassMatch / http://tomcat.company.com<-- been having issues with this directive
ProxyPassReverse / http://tomcat.company.com

As you can see we are using the mod_access (now called mod_authz_host in Apache 2.2) module to pass a variable called NLEDLPKEY so that only (Internet Explorer) clients with this variable could access Tomcat via SSL. Also, I am trying to not only reverse proxy SSL connections, but also to redirect the 403 errors (for people without the variable) to a specified page (error_page.html). I have tried:

ProxyPassMatch "^[^(/error_page.html)]" http://tomcat.company.com and also tried
ProxyPassMatch “^(?!/error_page.html)” http://tomcat.company.com

to see if it is possible to redirect to the error page and not get the below message:

Forbidden

You don't have permission to access /RDS on this server. <--RDS is just a directory-->

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 Server at apache-company Port 443

Any help would be appreciated

R.

clunk.werclick
07-31-2009, 06:39 PM
{snip working stuff}

ProxyPassMatch "^[^(/error_page.html)]" http://tomcat.company.com and also tried
ProxyPassMatch “^(?!/error_page.html)” http://tomcat.company.com

to see if it is possible to redirect to the error page and not get the below message:

Forbidden

You don't have permission to access /RDS on this server. <--RDS is just a directory-->

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 Server at apache-company Port 443

Any help would be appreciated

R.
Probably not relevant but the regex does not look right to me. From memory ^ either means beginning of a line *or* negation, so it looks like you are saying NOT error_page. Also, don't you need to escape the / with \ so / = \/ ?

Like I say, I may be off the mark, it just does not look right to me.