Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

One issue that may arise when configuring a load-balanced uPortal service is logs filled with the load balancer IPs. This is frustrating in that logs lose important, valuable information. This can be corrected if the load balancer has a mechanism to add the user's remote IP in a header. The header 'xX-forwardedForwarded-forFor' header is defined commonly used for this purpose. Once the load balancer is configured to add this header, Tomcats can then Apache http can use a module or Tomcat can use a Valve to use this IP valuereplace the IP address with the value of this header.

Code Block
languagexml
     <Valve className="org.apache.catalina.valves.RemoteIpValve"
               internalProxies="169\.236\.45\.28, 169\.236\.89\.28"
               remoteIpHeader="x-forwarded-for"
               remoteIpProxiesHeader="xX-forwardedForwarded-byFor"
               protocolHeader="x-forwarded-proto" />

In the example above, the load balancers have IPs of 169.236.45.28 and 169.236.89.28. 

Apache httpd - See https://httpd.apache.org/docs/current/mod/mod_remoteip.html.

Tomcat - See https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html or https://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Remote_IP_Valve.

Load Distribution

There are a number of algorithms for load distribution, none of them perfect.  Refer to your load balancer documentation for supported methods and additional guidance, including using pool groups (clusters at different data centers, for example) or weighting multiple factors.  

...