monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] changing relative paths of monit web server


From: Simon Mullis
Subject: Re: [monit] changing relative paths of monit web server
Date: Wed, 14 Nov 2007 10:32:34 +0100

Hi Martin,

Many thanks for this.  I've upgraded and all works well.

For reference, here's the appropriate nginx.conf entry:

http {
...
    server {
    ...
        location /path/to/monit {
           auth_basic            "Restricted";
           auth_basic_user_file  conf/htpasswd;
           rewrite ^/path/to/monit/(.*) /$1 break;
           proxy_pass http://127.0.0.1:2812;
       }
   }
}


Cheers!

SM

On Nov 13, 2007 9:48 PM, Martin Pala <address@hidden> wrote:
> Monit 4.9 and later should support setup behind reverse proxy (the
> URLs are relative since this version).
>
> Sample proxy configuration for Apache:
>    --8<--
>    ProxyPass /monit/ http://localhost:2812/
>    ProxyPassReverse /monit/ http://localhost:2812/
>    <Location /monit/>
>      AllowOverride None
>      AuthType Basic
>      AuthName sysadmin
>      AuthUserFile /etc/httpd/passwd
>      require valid-user
>    </Location>
>    --8<--
>
> Martin
>
>
> On Nov 13, 2007, at 3:16 PM, Simon Mullis wrote:
>
> > Hi All.
> >
> > Is there a way to explicitly set the relative URL path for the
> > monit web server?
> >
> > I want to be able to expose the monit web server via a reverse proxy
> > (in this case nginx).
> >
> > The nginx.conf entry:
> >
> > location /path/to/monit {
> >     rewrite ^/path/to/monit/(.*) /$1 break;
> >     proxy_pass http://127.0.0.1:2812
> > }
> >
> > The html created by the monit web server has all of its hrefs as
> > coming from the root.
> >
> > So, we have links of the form: <a href='/mysqld'>mysqld</a>
> >
> > I would like to have links created based on a relative path:
> >
> > <a href='/path/to/monit/mysqld'>mysqld</a>
> >
> > Looking at the source - specifically the config parser (p.y) - I don't
> > see this as an option:
> >
> > sethttpd        : SET HTTPD PORT NUMBER httpdlist {
> >                    Run.dohttpd= TRUE;
> >                    Run.httpdport= $4;
> >                  }
> >
> > I'm also looking into doing this with the web server (using
> > "sub_filter" on nginx) but I'm not convinced that it supports regexes
> > and capture groups.
> >
> > Thanks in advance for any help.
> >
> > Kind Regards
> >
> > SM
> >
> > --
> > Simon Mullis
> > _________________
> > address@hidden
> >
> >
> > --
> > To unsubscribe:
> > http://lists.nongnu.org/mailman/listinfo/monit-general
>
>
>
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general
>



-- 
Simon Mullis
_________________
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]