Skip to content

05 Webserver Configuration

Sean Vreeland edited this page Mar 19, 2019 · 10 revisions

Last edited 08 March 2019 by @seanvree

Below are a few examples of webserver configurations to use when hosting Monitorr:


NGINX & Linux:

  • NOTE: "alias" should be set to the path where the Monitorr repo is cloned to on the webserver's filesystem.
  • NOTE: The example below is set for PHP 7.0, If you are running 7.1 or 7.2, make sure you update the version in the fastcgi_pass section below.
location /monitorr {
        alias /var/www/apps/monitorr/;
        location ~ \.php$ {
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                include snippets/fastcgi-php.conf;
                fastcgi_param SCRIPT_FILENAME $request_filename;
                include fastcgi_params;
        }
}

NGINX & Docker:

location /monitorr {
	proxy_pass http://10.0.0.11:4078/monitorr;
	add_header X-Frame-Options SAMEORIGIN;
	proxy_set_header Host $host;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

NGINX & Windows:

Assumptions:

  • NGINX and PHP are already and installed on the webserver. If not, follow the below guide to install NGINX and/or PHP:

https://github.com/causefx/Organizr/wiki/Windows-Installation:--Nginx-%7C-PHP-%7C-Organizr#manual-install-installing-nginx--running-it-as-a-service

  • Your PHP installation is installed to C:\nginx\php\

  • PHP daemon is listening on 127.0.0.1:9000

  • You cloned/downloaded the Monitorr repo to: c:\nginx\www\Monitorr\ (The main Monitorr index file should reside at: c:\nginx\www\Monitorr\index.php)

  • Your NGINX Block will look like this:

        location /monitorr { 
            root c:/nginx/www;
            autoindex on;
            index index.php;
            location ~ .php$ {
                include        fastcgi_params;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
            }
        }

Caddy:

  • Add the following to your caddyfile:
templates {
   ext .php
 }

Testing:

  • Browse to [monitorr repo]/assets/php/phpinfo.php
  • Your browser output should look like this:

If you need help, please join us on DISCORD here: Discord