Rewrite with proxy_pass

Simon Mullis simon at
Mon Nov 12 18:31:44 MSK 2007

Hi All,

I've set up monit ( which by default
runs an http admin server on a local tcp port of your choice.

I want to proxy requests from the outside world, via nginx, to this
tcp port.  I also then need to change the URI that is sent to the
monit web server, removing the fixed path from the URI.


server {
         location / {
         location /monitor/app_a {
         location /monitor/monit {
              rewrite ^/monitor/monit/(.*) /$1;

But!  It doesn't work....  It seems that I'm passing the wrong URI to monit.

I can tell this from packet capturing on port 2812.

What am I doing wrong?



Simon Mullis
simon at

More information about the nginx mailing list