Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Apache and mod_proxy to provide access to the Monit GUI over HTTP. So far my configuration is as follows:

    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    ProxyPreserveHost on
    ProxyPass /monit http://localhost:2812/
    ProxyPassReverse /monit http://localhost:2812/

When people go to http://mywebsite/monit they do get the Monit home page. However the links returned by Monit have an absolute path, which breaks the proxy which is only applied to paths starting with /monit. I could create a separate vhost just for Monit (e.g. http://monit.mywebsite) which would fix the problem, but was wondering if there was another solution.

Q1: Is there a way to get Apache to rewrite links in HTML code to prepend whatever path is defined in the ProxyPass and ProxyPassReverse directive?

Q2: If above not possible, do you see another solution than the separate vhost I **mentioned?

share|improve this question


Your proxy setup is slightly incorrect:

it should be:

ProxyRequests Off
<Proxy *>
        Order deny,allow
        Allow from all
ProxyPreserveHost on
ProxyPass /monit http://localhost:2812
ProxyPassReverse /monit http://localhost:2812

notice the difference? In your setup you remove a / to many.

you could also go for

ProxyPass /monit/ http://localhost:2812/
ProxyPassReverse/ /monit http://localhost:2812/

but then requests to http://mywebsite/monit would not work, only to http://mywebsite/monit/ which would be kind of inconvenient.

OLD Response

Probably mod_proxy_html could do what you want but as far as I know it's never the best solution.... I don't know Monit but isn't there an option in it to make it only use relative paths?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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