proxy_pass to multi background monit http services

Chris Kraybill lists at
Tue Mar 24 00:39:13 MSK 2009

Seven Du wrote:
> monit has an embedded web interface, I want to use nginx to proxy
> several servers:
>         location /server1/ {
>                 rewrite ^/sever1/(.*) /$1 break;
>                 proxy_pass http://localhost:2812; #monit default port
>         }
>         location /server2/ {.....}
> The first page of each monit server displays well but because all links
> in monit has absolute path instead of
>, I don't know hot to make
> that work.

Had the same problem. I was running monit 4.8 and running into the same 
issues. You need monit 4.9 or later to handle reverse proxying. This 
post helped me get monit 4.10 installed without re-compiling from 

> Can nginx do that? or we need to modify monit?

So the answer is yes, nginx can do this with the proper version of 
monit. Here's the relevant nginx set-up that worked for me:

        location /monit/ {
                auth_basic "Restricted";
                auth_basic_user_file /etc/nginx/auth.passwd;
                rewrite ^/monit/(.*) /$1 break;

Hope this helps you
Posted via

More information about the nginx mailing list