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

<Proxy balancer://tomcatCluster>
    BalancerMember ajp://qa-app1:8009 route=1
    BalancerMember ajp://qa-app2:8009 route=2
    ProxySet stickysession=ROUTEID
<ProxyMatch "^/(mytomcatappA|mytomcatappB)/(.*)" >
    ProxyPassMatch  balancer://tomcatCluster/$1/$2
#proxy anything that's not a tomcat URL to IIS on port 80
<Proxy />
    ProxyPass http://qa-web1/


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>.

  • 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 '11 at 14:58


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


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.