-
Notifications
You must be signed in to change notification settings - Fork 12
05 Webserver Configuration
Sean Vreeland edited this page Mar 19, 2019
·
10 revisions
Last edited 08 March 2019 by @seanvree
- 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;
}
}
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 and PHP are already and installed on the webserver. If not, follow the below guide to install NGINX and/or PHP:
-
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;
}
}
- Add the following to your caddyfile:
templates {
ext .php
}
- Browse to
[monitorr repo]/assets/php/phpinfo.php
- Your browser output should look like this: