Description |
This package extends the standard theming middleware of Diazo to add the ability to read
the location of a rules XML file from the WSGI environment. This means, amongst being
able to read a rules location from the environment for the local user, that an upstream
service (such as a web server, reverse proxy, caching proxy, etc) is able to control the
theme the middleware is using – and change this for any given request. This contrasts
with the configuration-based approach taken by Diazo’s standard middleware, which
requires a fixed path to be specified for the middleware.
So, this means with the right WSGI configuration, you could conceivably have one Diazo
instance serving any number of themes without needing to explicitly configure paths,
urlmaps or the like. If you combine this with a suitable front-facing tool (such as a
configurable web server like Apache, Nginx, Cherokee, or any other), then you can have
this one Diazo instance theming any number of applications, and theming differently
based upon any condition your web server supports – such as incoming host name, HTTP vs
HTTPS, specific URLs or regex, headers, IP addresses, and more. To achieve this, all you
need to do is set the right HTTP header – which is the path to your rules file – and
ensure this is sent to your middleware based upon your various conditions.
|