A patch that enables SpiffWorkflow Backend to support nginx https proxy fronting spiffworkflow-backend running on http

This commit is contained in:
Kok Hoor 2023-05-01 21:38:47 +08:00
parent 1ea36658cc
commit bc34afdc2d
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,9 @@ from spiffworkflow_backend.services.acceptance_test_fixtures import (
)
app = create_app()
if os.environ.get("SPIFFWORKFLOW_BACKEND_USE_WERKZEUG_MIDDLEWARE_PROXY_FIX") == "true":
from werkzeug.middleware.proxy_fix import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1)
# this is in here because when we put it in the create_app function,
# it also loaded when we were running migrations, which resulted in a chicken/egg thing.