PDA

View Full Version : Context to Monit External App


hugemikeyd
05-01-2008, 11:04 AM
I am trying to map http://myhost.com/monit to my local running monit http instance.

What i have configured is an monit external app configured as a webserver at 127.0.0.1:2812 and then i create a context in my VHost that takes /monit and points it to the monit external app as a proxy.

All i get in a 404 not found from monit.

I am thinking that the context is taking http://myhost.com/monit and creating a http://127.0.0.1/monit, which is incorrect. Is this correct? Is there something i can do to take care of this?

Thanks,

Michael

mistwang
05-01-2008, 11:10 AM
When LSWS proxy the request to monit, it will not change the domain name, so monit will receive request http://myhost.com/monit instead of http://127.0.0.1/monit.

hugemikeyd
05-01-2008, 11:19 AM
So can i rewrite that at least the path part off?

mistwang
05-01-2008, 11:30 AM
I think it should work if you use a rewrite rule to tell LSWS to proxy the request, get rid of the context.

RewriteRule ^/monit(.*) http://<name_of_proxy_app>/$1 [P]

hugemikeyd
05-01-2008, 11:47 AM
ah using the external app name was the key, i didn't think i could do that and was trying to use 127.0.0.1.

Thanks!