Prepare app for working behind a proxy (nginx).
Adapt user form
This commit is contained in:
7
common/utils/nginx_utils.py
Normal file
7
common/utils/nginx_utils.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from flask import current_app, request, url_for
|
||||
|
||||
|
||||
def prefixed_url_for(endpoint, **values):
|
||||
prefix = request.headers.get('X-Forwarded-Prefix', '')
|
||||
current_app.logger.debug(f'prefix: {prefix}')
|
||||
return prefix + url_for(endpoint, **values)
|
||||
Reference in New Issue
Block a user