M/Monit and nginx reverse proxy?

Issue #631 closed
Barbeque Sauce created an issue

I'm looking to set M/Monit (not Monit) to be reached through my nginx reverse proxy when I'm offsite. I have a dozen other services set up already with a base URL (i.e. /couchpotato, /webmail, etc.)

I have only seen proxy configs for Monit as a server root or sub domain; is this configuration possible?

Comments (4)

  1. Tildeslash repo owner

    Hello,

    you can find proxy setup instructions in the M/Monit manual (https://mmonit.com/documentation/mmonit_manual.pdf, chapter "M/Monit behind a proxy"), snip for nginx:

    location /mmonit/ {
        rewrite ^/mmonit/(.*) /$1 break;
        proxy_pass  http://192.168.1.10:8080;
        proxy_redirect http://192.168.1.10:8080 /mmonit;
        proxy_cookie_path / /mmonit/
    }
    
  2. Barbeque Sauce reporter

    Thanks. I'd tried that, however; it seems that the example works just fine in a case where both the nginx proxy and the M/Monit instance are http. My scenario is a little different - the M/Monit instance is still http, but the nginx proxy is serving https to the outside world.

    I recognize that this isn't an nginx forum, but I would have thought you might have encountered this issue before...

  3. Tildeslash repo owner

    We tested only apache as https->http proxy and it works fine (the example is part of the M/Monit manual), nginx should work fine too.

    Note that if you use https->http proxy for M/Monit as subdomain (e.g. https://mmonit.mydomain.com instead of proxy path like "https://proxy.mydomain.com/mmonit/", it is also necessary to set "proxyScheme"attribute in M/Monit's configuration to https (please see details i M/Monit manual).

  4. Log in to comment