How to configure a custom HTTP header for client IP detection in Parallels RAS Secure Gateway

0 users found this article helpful

When Parallels RAS Secure Gateway is deployed behind a reverse proxy or load balancer, the gateway reads the original client IP address from the X-Forwarded-For HTTP header by default. Some reverse proxy configurations use a different header for this purpose — for example, X-Real-IP (common in Nginx setups) or a custom organization-specific header.

Starting with Parallels RAS 21.2, you can configure the gateway to read the client IP from a different header using the RealIPHttpHeader registry value. This article explains how to set it up.

Important: Only configure this setting when the RAS Secure Gateway is behind a trusted reverse proxy or load balancer that is responsible for setting the header. If the gateway is directly reachable by clients, end users can inject arbitrary values into any header, allowing them to spoof their IP address. Ensure your reverse proxy strips any client-supplied values for this header before forwarding the request to the gateway.

How to configure a custom IP header

  1. Sign in to the server running the Parallels RAS Secure Gateway with administrative privileges.
  2. Open Registry Editor (regedit.exe).
  3. Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Parallels\2XProxyGateway
  4. Create a new String Value (REG_SZ) named RealIPHttpHeader.
  5. Set its value to the name of the HTTP header your reverse proxy uses to forward the original client IP — for example, X-Real-IP.
  6. Restart the Parallels RAS Secure Gateway service for the change to take effect.

If the value is set to an empty string or the registry entry does not exist, the gateway falls back to the default behavior and reads the client IP from the X-Forwarded-For header.

Example: Registry file

The following .reg file content configures the gateway to use X-Real-IP. Save it as a .reg file, import it on the gateway server, and restart the gateway service.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Parallels\2XProxyGateway]
"RealIPHttpHeader"="X-Real-IP"

Replace X-Real-IP with the header name used by your reverse proxy.

Registry value reference

Setting Detail
Registry path HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Parallels\2XProxyGateway
Value name RealIPHttpHeader
Value type String Value (REG_SZ)
Example value X-Real-IP
Default behavior If empty or not set, the gateway uses X-Forwarded-For
Available from Parallels RAS 21.2

Was this article helpful?

Tell us how we can improve it.