From 13bfffb34cd0385124d4084a66d49471cb457b6c Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 10 Aug 2014 14:01:43 +0200 Subject: Add README file Documents requirements, installation instructions (obsoleting doc/INSTALL) and performance hints. Added a nginx server configuration example that optimises for performance. --- doc/INSTALL | 3 --- doc/nginx.conf | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) delete mode 100644 doc/INSTALL create mode 100644 doc/nginx.conf (limited to 'doc') diff --git a/doc/INSTALL b/doc/INSTALL deleted file mode 100644 index c0da959..0000000 --- a/doc/INSTALL +++ /dev/null @@ -1,3 +0,0 @@ -CGP is designed to run out of the box. If you want to modify some -configuration settings, please create conf/config.local.php to overrule -the settings from conf/config.php. diff --git a/doc/nginx.conf b/doc/nginx.conf new file mode 100644 index 0000000..d2efa46 --- /dev/null +++ b/doc/nginx.conf @@ -0,0 +1,41 @@ +server { + listen 80; + server_name localhost; + + root /srv/http; + index index.php; + + # This catches requests other than /CGP/rrd/ and PHP (see below) + location /CGP/ { + gzip on; + gzip_types "application/javascript text/css"; + # The static files do not change often, cache hint 1 month + expires 1M; + } + + # Assume that CGP is located at /srv/http/CGP/, directly serve the RRD data + # files for use with the canvas graph type. Add compression to reduce data + # usage by 70% - 80%. + location /CGP/rrd/ { + alias /var/lib/collectd/rrd/; + gzip on; + gzip_types "*"; + # Cache hint: browser can recheck after 10 minutes + expires 10m; + #gzip_comp_level 3; + } + + # Process PHP files through PHP-FPM + location ~ \.php$ { + try_files $uri =404; + fastcgi_pass unix:/run/php5-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + + # Disallow access to hidden files and directories (such as .git/) + location ~ /\. { + deny all; + } +} -- cgit v1.1