Home /  Monit /  Nginx

Monit can be used from behind a proxy server.

Here is an example on how to configure Nginx proxy in front of Monit. In this example Monit listens on and we configure Nginx so Monit is accessible via this Nginx proxy URL, http://nginx.addr.ess/monit/

    location /monit/ {
        rewrite ^/monit/(.*) /$1 break;
        proxy_ignore_client_abort on;
        proxy_redirect /monit; 
        proxy_cookie_path / /monit/;

If the proxy redirect does not redirect correctly to e.g. https://nginx.addr.ess/monit/* when you click on an action button in Monit, like [start, stop, unmonitor], try to add the full destination URL to proxy_redirect instead, like so:

    proxy_redirect https://nginx.addr.ess/monit; 

Note that we here also redirect from http (Monit) to https (Nginx)