Add in rewrite rule to check swift

If the requested file doesn't exist locally ask the os-loganalyze
wsgi app to handle the request anyway incase it can fetch the request
from swift.

Change-Id: I8ed3a4c7b9a9fa682dbc4c3f3ffee8ddf2c237c6
This commit is contained in:
Joshua Hesketh 2014-07-04 10:27:44 +10:00
parent b60f78b1c1
commit cf71602cc7
2 changed files with 16 additions and 0 deletions
modules/openstack_project/templates

@ -61,6 +61,14 @@ NameVirtualHost <%= vhost_name %>:<%= port %>
# rewrite all txt.gz & html.gz files to map to our internal htmlify wsgi app
RewriteRule ^/(.*\.txt\.gz)$ /htmlify/$1 [QSA,L,PT]
RewriteRule ^/(.*console\.html(\.gz)?)$ /htmlify/$1 [QSA,L,PT]
# 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
RewriteRule ^/(.*)$ /htmlify/$1 [QSA,L,PT]
WSGIScriptAlias /htmlify /usr/local/lib/python2.7/dist-packages/os_loganalyze/wsgi.py
ErrorLog /var/log/apache2/<%= name %>_error.log

@ -61,6 +61,14 @@ NameVirtualHost <%= vhost_name %>:<%= port %>
# rewrite all txt.gz & html.gz files to map to our internal htmlify wsgi app
RewriteRule ^/(.*\.txt\.gz)$ /htmlify/$1 [QSA,L,PT]
RewriteRule ^/(.*console\.html(\.gz)?)$ /htmlify/$1 [QSA,L,PT]
# 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
RewriteRule ^/(.*)$ /htmlify/$1 [QSA,L,PT]
WSGIScriptAlias /htmlify /usr/local/lib/python2.7/dist-packages/os_loganalyze/wsgi.py
ErrorLog /var/log/apache2/<%= name %>_error.log