1

I'm having a problem getting /server-status to work Apache 2.2.14 on Ubuntu Server 10.04.1.

The default symlinks for status.load and status.conf are present in /etc/apache2/mods-enabled. The status.conf does include the location /server-status and appropriate allow/deny directives.

However, the only vhost I have in sites-enabled looks like this. The idea is to proxy anything with a Tomcat URL to a cluster of tomcats, and anything else to an IIS box. However, this seems to result in requests to /server-status being sent to IIS. Copying the /server-status in explicitly to the Vhost configuration doesn't seem to help, no matter what order I use. Is it possible to include /server-status do this within a vhost configuration that has a "default" proxy rule?:

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy balancer://tomcatCluster>
    BalancerMember ajp://qa-app1:8009 route=1
    BalancerMember ajp://qa-app2:8009 route=2
    ProxySet stickysession=ROUTEID
</Proxy>
<ProxyMatch "^/(mytomcatappA|mytomcatappB)/(.*)" >
    ProxyPassMatch  balancer://tomcatCluster/$1/$2
</ProxyMatch>
#proxy anything that's not a tomcat URL to IIS on port 80
<Proxy />
    ProxyPass http://qa-web1/
</Proxy>

2 Answers 2

2

You need to add an exclusion for proxy — your ProxyPass and ProxyPassMatch directives should look like:

ProxyPassMatch ^/(mytomcatappA|mytomcatappB)/(.*) balancer://tomcatCluster/$1/$2
ProxyPass /server-status !
ProxyPass / http://qa-web1/

! in place of the target URL means “exclude the specified path from proxying”. Directives should be ordered with the most specific URL first, because the first matching directive is used.

And putting ProxyPass and ProxyPassMatch inside <Proxy> and <ProxyMatch> containers is not documented — not sure whether it should really work correctly; just place them inside <VirtualHost>.

1
  • Thanks, your suggestions worked perfectly. We've been using nginx for quite a while as a proxy, but need to switch to apache to do some intricate header rewriting than nginx cannot do. Apache configuration is... different than nginx. I can't decide if it is worse or better (there are a lot of surpirses in nginx configuration as well).
    – rmalayter
    Feb 15, 2011 at 14:58
1

Replace:

<Proxy />
    ProxyPass http://qa-web1/
</Proxy>

With:

<ProxyMatch ! "^/server-status">
    ProxyPass http://qa-web1/
</Proxy>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .