Riva Insight Load Balancing Requirements

Rawan Maarouf
Rawan Maarouf
  • Updated

For a Highly Available (HA) configuration — with an internal load balancer and multiple servers — and a Disaster Recovery (DR) strategy, a Riva Insight installation on-premises has the following requirements.

  • Network Layer Requirements
     
    • For Active/Active configurations:
      • Recommended: Layer 7 Load balancing with cookie-based sticky sessions; certificates & session "stickiness" can be configured in the load balancer. This also allows the servers themselves to use local certificates.
      • Alternative: Layer 3 or 4 Load balancing with IP-based sticky sessions; 
        • Note: For sticky sessions, for best performance, ensure the session duration of at least 24 hours for the best user experience.
      • All servers must run the same Riva Insight version. For Insight 2025.2 and earlier (IIS), both servers must also share the same machine key, found in the ASP.NET web.config.
      • A certificate is required on the load balancer. For the server-side options, see Security below.
      • Use Redis for session management (the use of the ASP.NET State Service for Riva Insight is no longer supported).
        • Redis must be a shared instance used by all servers.
           
    • For Active/Passive configurations:
      • A NAT configuration with appropriate network probes.
         
  • Health Checks
     
    • Health checks are required to determine if the host is available.
      • For basic health checks, use a TCP check on the Insight port (default 5001). 
      • For more advanced deployments, use the {BasePath}/health.check endpoint (for example, /insight/health.check)
         
  • Security
     
    • In some load balancer configurations,  the front-end URL is configured for HTTPS and traffic is routed to the internal servers.
      • When the internal servers are configured to NOT use SSL, this will create challenges with Riva Insight as the internal servers will recognize that the site is not running on HTTPS/SSL.
        Therefore, the authentication cookies will not be secure.
      • The cookies will not be sent back to the client browser as the browser expects the secure cookies, while the server created the 'Not Secure' cookies.
        Without the secure cookies, the authentication session cannot be validated and the user is sent back to the login page.
         
    • To have Riva Insight run within this load balancer configuration, there are two options:
       
      • Option 1 (recommended):
        • Have the internal servers configured with HTTPS (and SSL Certs)
        • Have the load balancer forward the traffic to the HTTPS sites (urls)
           
      • Option 2:
        • Insight 2026.3 and later: In appsettings.OnPremises.json, set "Insight.UseSecureConnectionForLb": "true" and "HTTPSCertificate": { "UseCertificate": "false" } under AppSettings. This marks cookies as Secure and SameSite=None and trusts the forwarded headers from the load balancer.
        • Insight 2025.2 and earlier (IIS): Upgrade Riva Insight Server to version 2023.1.8.9668 or higher, then:
        • Add the following key to ~\Insight\App_Data\AppSettings.xml (Insight 2025.2 and earlier only):
          • Insight.UseSecureConnectionForLB = true

Considerations:

  • What type of Load Balancing technology is being utilized?
  • What are the recovery expectations? If using an Active/Active setup, recovery time could be 0 minutes.

See also:


Insight 2025.2 (IIS) and earlier

 

Adding the X-Forwarded-For (Original Client IP) to the IIS Server Logs

 

This is the PowerShell command to add X-Forwarded-For header at the server level.

Powershell

Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.applicationHost/sites/siteDefaults/logFile/customFields" -name "." -value @{logFieldName='X-Forwarded-For';sourceName='X-Forwarded-For';sourceType='RequestHeader'}

 

Add X-Forwarded-For column in IIS 8.5 and newer versions

Custom logging became easier to configure with the IIS 8.5. Follow the steps below to add X-Forwarded-For column into IIS logs.

  1. Open IIS Manager
  2. On server, site or application level, double click “Logging”
  3. Click “Select Fields“
  4. In “W3C Logging Fields” window, click “Add Field“
  5. In the “Add Custom Field” window, fill out the following fields
    • Field Name: X-Forwarded-For, Source type: Request Header, Source: X-Forwarded-For
  6. Click “OK” in both open windows
  7. Click “Apply” in the actions pane