Commits

Anonymous committed c1326d7

0.12.3dev: Adds support for X-Forwarded-Proto header to resolve backend servers behind a proxy server.

Patch by John Hampton. Closes #8131.

  • Participants
  • Parent commits ae5859e
  • Branches 0.12-stable

Comments (0)

Files changed (1)

File trac/web/wsgi.py

         environ['wsgi.url_scheme'] = 'http'
         if environ.get('HTTPS', '').lower() in ('yes', 'on', '1'):
             environ['wsgi.url_scheme'] = 'https'
+        elif environ.get('HTTP_X_FORWARDED_PROTO', '').lower() == 'https':
+            environ['wsgi.url_scheme'] = 'https'
         environ['wsgi.input'] = stdin
         environ['wsgi.errors'] = stderr
         environ['wsgi.multithread'] = self.wsgi_multithread