From 5c20d08eda8446cc6f45e1a94354183df2aed062 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Wed, 30 May 2018 16:01:43 +0100 Subject: [PATCH] Documented nginx config for static serving Includes details on how to make nginx serve prezipped files directly, like index.html.gz ones. Change-Id: I1c64a1653f172cbb1723eaaa6e183605cf73d06a --- doc/source/webserver.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/source/webserver.rst b/doc/source/webserver.rst index 52efd7a9..ffd00373 100644 --- a/doc/source/webserver.rst +++ b/doc/source/webserver.rst @@ -262,3 +262,28 @@ Restart Apache and you're done:: systemctl restart apache2 You should now be able to access the web interface at the domain you set up ! + +Serving static HTML reports +--------------------------- + +Nginx Configuration +~~~~~~~~~~~~~~~~~~~ + +Assuming that you are storing ARA reports as static html using a Nginx server +you may find this configuration useful as it assures that prezipped files +(like ``index.html.gz``) are served transparently by the server. :: + + location /artifacts { + gzip_static on; + root /var/www/html; + autoindex on; + index index.html index.htm; + rewrite ^(.*)/$ $1/index.html; + } + +You may need a different nginx build that has the ngx_http_gzip_static_module_ +compiled. For example nginx from EPEL_ (CentOS/RHEL) +yum repositories includes this module. + +.. _ngx_http_gzip_static_module: http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html +.. _EPEL: https://fedoraproject.org/wiki/EPEL