I detect if trac is being proxied. If it is, I assume it's being proxied for https and assign the scheme appropriately:
"""Reconstruct the absolute base URL of the application."""
host = self.get_header('Host')
scheme = self.scheme
if self.get_header('X-Forwarded-Host'):
scheme = 'https'
if not host:
# Missing host header, so reconstruct the host from the
# server name and port
default_port = {'http': 80, 'https': 443}
if self.server_port and self.server_port != default_port[self.scheme]:
host = '%s:%d' % (self.server_name, self.server_port)
else:
host = self.server_name
return urlparse.urlunparse((schemeself.scheme, host, self.base_path, None,
None, None))
(in web/api.py, if anyone cares)
