absolute_url(tgpath=' / ' ,
params=None,
**kw)
|
|
Return absolute URL (including schema and host to this server).
Tries to account for 'Host' header and reverse proxying
('X-Forwarded-Host').
The host name is determined this way:
* If the config setting 'tg.url_domain' is set and non-null, use this value.
* Else, if the 'base_url_filter.use_x_forwarded_host' config setting is
True, use the value from the 'Host' or 'X-Forwarded-Host' request header.
* Else, if config setting 'base_url_filter.on' is True and
'base_url_filter.base_url' is non-null, use its value for the host AND
scheme part of the URL.
* As a last fallback, use the value of 'server.socket_host' and
'server.socket_port' config settings (defaults to 'localhost:8080').
The URL scheme ('http' or 'http') used is determined in the following way:
* If 'base_url_filter.base_url' is used, use the scheme from this URL.
* If there is a 'X-Use-SSL' request header, use 'https'.
* Else, if the config setting 'tg.url_scheme' is set, use its value.
* Else, use the value of 'cherrypy.request.scheme'.
|