Use the paste deploy prefix middleware instead of my wsgi hack.
This commit is contained in:
parent
cc2595aea7
commit
f4549c7a90
2 changed files with 8 additions and 8 deletions
|
@ -13,11 +13,4 @@ from pyramid.paster import get_app, setup_logging
|
||||||
ini_path = '/etc/tahrir/tahrir.ini'
|
ini_path = '/etc/tahrir/tahrir.ini'
|
||||||
setup_logging(ini_path)
|
setup_logging(ini_path)
|
||||||
|
|
||||||
pyramid_app = get_app(ini_path, 'main')
|
application = 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
|
|
||||||
|
|
|
@ -2,10 +2,17 @@
|
||||||
pipeline =
|
pipeline =
|
||||||
tahrir
|
tahrir
|
||||||
|
|
||||||
|
[filter:proxy-prefix]
|
||||||
|
use = egg:PasteDeploy#prefix
|
||||||
|
prefix = /badges
|
||||||
|
scheme = https
|
||||||
|
|
||||||
[app:tahrir]
|
[app:tahrir]
|
||||||
|
|
||||||
use = egg:tahrir
|
use = egg:tahrir
|
||||||
|
|
||||||
|
filter-with = proxy-prefix
|
||||||
|
|
||||||
#pyramid.reload_templates = true
|
#pyramid.reload_templates = true
|
||||||
pyramid.default_locale_name = en
|
pyramid.default_locale_name = en
|
||||||
pyramid.includes =
|
pyramid.includes =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue