diff --git a/spiffworkflow-backend/wsgi.py b/spiffworkflow-backend/wsgi.py index d3c0ba5e..7d9d954d 100644 --- a/spiffworkflow-backend/wsgi.py +++ b/spiffworkflow-backend/wsgi.py @@ -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.