mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
pgAdmin4 unable to work behind Nginx reverse proxy running on a non-standard port.
Werkzeug middleware allows us to set the number of trusted ports and few other params behind the proxy. By default values are set to zero. Added 'X-Forwarded-*' configuration options and set the default value of the port to 1 to work with non-standard port. Fixes #4768
This commit is contained in:
committed by
Akshay Joshi
parent
56e00d74ad
commit
faf8062830
@@ -71,7 +71,13 @@ if not os.path.isfile(config.SQLITE_PATH):
|
||||
class ReverseProxied(object):
|
||||
def __init__(self, app):
|
||||
# https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
|
||||
self.app = ProxyFix(app)
|
||||
self.app = ProxyFix(app,
|
||||
x_for=config.PROXY_X_FOR_COUNT,
|
||||
x_proto=config.PROXY_X_PROTO_COUNT,
|
||||
x_host=config.PROXY_X_HOST_COUNT,
|
||||
x_port=config.PROXY_X_PORT_COUNT,
|
||||
x_prefix=config.PROXY_X_PREFIX_COUNT
|
||||
)
|
||||
|
||||
def __call__(self, environ, start_response):
|
||||
script_name = environ.get("HTTP_X_SCRIPT_NAME", "")
|
||||
|
||||
Reference in New Issue
Block a user