Home | Trees | Indices | Help |
|
---|
|
object --+ | VirtualHost
Select a different WSGI application based on the Host header.
This can be useful when running multiple sites within one CP server. It allows several domains to point to different applications. For example:
root = Root() RootApp = cherrypy.Application(root) Domain2App = cherrypy.Application(root) SecureApp = cherrypy.Application(Secure()) vhost = cherrypy._cpwsgi.VirtualHost(RootApp, domains={'www.domain2.example': Domain2App, 'www.domain2.example:443': SecureApp, }) cherrypy.tree.graft(vhost)
|
|||
|
|||
|
|||
Inherited from |
|
|||
default = None Required. |
|||
use_x_forwarded_host = True If True (the default), any "X-Forwarded-Host" request header will be used instead of the "Host" header. |
|||
domains =
A dict of {host header value: application} pairs. |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
|
defaultRequired. The default WSGI application.
|
use_x_forwarded_hostIf True (the default), any "X-Forwarded-Host" request header will be used instead of the "Host" header. This is commonly added by HTTP servers (such as Apache) when proxying.
|
domainsA dict of {host header value: application} pairs. The incoming "Host" request header is looked up in this dict, and, if a match is found, the corresponding WSGI application will be called instead of the default. Note that you often need separate entries for "example.com" and "www.example.com". In addition, "Host" headers may contain the port number.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Sep 27 14:39:45 2013 | http://epydoc.sourceforge.net |