44 lines
1.6 KiB
Plaintext
44 lines
1.6 KiB
Plaintext
Listen %PORT%
|
|
<VirtualHost *:%PORT%>
|
|
DocumentRoot %OS_LOGANALYZE_APACHE_DOCUMENTROOT%
|
|
|
|
# use Apache to compress the results afterwards, to save on the wire
|
|
# it's approx 18x savings of wire traffic to compress. We need to
|
|
# compress by content types that htmlify can produce
|
|
AddOutputFilterByType DEFLATE text/plain text/html
|
|
|
|
<FilesMatch \.html\.gz$>
|
|
ForceType text/html
|
|
AddDefaultCharset UTF-8
|
|
AddEncoding x-gzip gz
|
|
</FilesMatch>
|
|
<Directory %OS_LOGANALYZE_DIR%>
|
|
Allow from all
|
|
Satisfy Any
|
|
</Directory>
|
|
|
|
RewriteEngine On
|
|
# rewrite txt.gz & console.html[.gz] files to map to our internal htmlify
|
|
# wsgi app
|
|
# PT, Pass-through: to come back around and get picked up by the
|
|
# WSGIScriptAlias
|
|
# NS, No-subrequest: on coming back through, mod-autoindex may have added
|
|
# index.html which would match the !-f condition. We
|
|
# therefore ensure the rewrite doesn't trigger by
|
|
# disallowing subrequests.
|
|
RewriteRule ^/(.*\.txt\.gz)$ /htmlify/$1 [QSA,L,PT,NS]
|
|
RewriteRule ^/(.*console\.html(\.gz)?)$ /htmlify/$1 [QSA,L,PT,NS]
|
|
|
|
# Check if the request exists as a file, directory or symbolic link
|
|
# If not, write the request to htmlify to see if we can fetch from swift
|
|
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
|
|
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
|
|
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l
|
|
RewriteCond %{REQUEST_FILENAME} !^/icon
|
|
RewriteRule ^/(.*)$ /htmlify/$1 [QSA,L,PT,NS]
|
|
|
|
WSGIScriptAlias /htmlify %OS_LOGANALYZE_DIR%/os_loganalyze/wsgi.py
|
|
LogLevel warn
|
|
ServerSignature Off
|
|
</VirtualHost>
|