diff --git a/docs/en_US/container_deployment.rst b/docs/en_US/container_deployment.rst index 6d48aabc3..1a8c66524 100644 --- a/docs/en_US/container_deployment.rst +++ b/docs/en_US/container_deployment.rst @@ -197,24 +197,33 @@ for example: -e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" \ -d dpage/pgadmin4 -pgAdmin X-Forwarded-* configuration +pgAdmin X-Forwarded-* Configuration ----------------------------------- -You must tell the middleware how many proxies set each header so it knows what values to trust. -Below are the pgAdmin configuration parameters for X-Forwarded-* options with default values. -pgAdmin is ready by default to run behind reverse proxy even on a non-standard port and -these config options don't need to be changed. If required, you can tweak these config as per your need. +pgAdmin needs to understand how many proxies set each header so it knows what +values to trust. The configuration parameters for the X-Forwarded-* options +which are used for this purpose are shown below, along with their default +values. + +pgAdmin is configured by default to be able to run behind a reverse proxy even +on a non-standard port and these config options don't normally need to be +changed. If you're running an unusual configuration (such as multiple reverse +proxies) you can adjust the configuration to suit. .. code-block:: python # Number of values to trust for X-Forwarded-For PROXY_X_FOR_COUNT = 1 + # Number of values to trust for X-Forwarded-Proto. PROXY_X_PROTO_COUNT = 0 + # Number of values to trust for X-Forwarded-Host. PROXY_X_HOST_COUNT = 0 + # Number of values to trust for X-Forwarded-Port. PROXY_X_PORT_COUNT = 1 + # Number of values to trust for X-Forwarded-Prefix. PROXY_X_PREFIX_COUNT = 0 diff --git a/web/config.py b/web/config.py index fe4628a34..3035fd791 100644 --- a/web/config.py +++ b/web/config.py @@ -158,15 +158,21 @@ SECURITY_PASSWORD_HASH = 'pbkdf2_sha512' # Reverse Proxy parameters # You must tell the middleware how many proxies set each header # so it knows what values to trust. -# See https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#werkzeug.middleware.proxy_fix.ProxyFix for more info. # noqa +# See https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#werkzeug.middleware.proxy_fix.ProxyFix +# for more information. + # Number of values to trust for X-Forwarded-For PROXY_X_FOR_COUNT = 1 + # Number of values to trust for X-Forwarded-Proto. PROXY_X_PROTO_COUNT = 0 + # Number of values to trust for X-Forwarded-Host. PROXY_X_HOST_COUNT = 0 + # Number of values to trust for X-Forwarded-Port. PROXY_X_PORT_COUNT = 1 + # Number of values to trust for X-Forwarded-Prefix. PROXY_X_PREFIX_COUNT = 0