Use the paste deploy prefix middleware instead of my wsgi hack.

This commit is contained in:
Ralph Bean 2013-07-03 22:03:38 +00:00
parent cc2595aea7
commit f4549c7a90
2 changed files with 8 additions and 8 deletions

View file

@ -13,11 +13,4 @@ from pyramid.paster import get_app, setup_logging
ini_path = '/etc/tahrir/tahrir.ini'
setup_logging(ini_path)
pyramid_app = get_app(ini_path, 'main')
def reverse_proxy_handler(environ, start_response):
environ['HTTP_HOST'] = environ['HTTP_X_FORWARDED_HOST']
environ['wsgi.url_scheme'] = 'https'
return pyramid_app(environ, start_response)
application = reverse_proxy_handler
application = get_app(ini_path, 'main')

View file

@ -2,10 +2,17 @@
pipeline =
tahrir
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /badges
scheme = https
[app:tahrir]
use = egg:tahrir
filter-with = proxy-prefix
#pyramid.reload_templates = true
pyramid.default_locale_name = en
pyramid.includes =