Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

If you are using a Load Balancer that offloads HTTPS, FlexDeploy will see the incoming connections from the load balancer as HTTP. This will cause it to generate relative paths with http:// instead of https://. Those URLS are redirected by the load balancer, starting a infinite loop. There is a great article about it here: https://community.pivotal.io/s/article/Purpose-of-the-X-Forwarded-Proto-HTTP-Header?language=en_US

To avoid that loop, you can either

Set your http connector to scheme=”https”. This works if you won’t ever hit that URL without the Load Blancer/Proxy. <Connector port="8000" protocol="HTTP/1.1" connectionTimeout="20000" maxHttpHeaderSize="32768" schema="https"/>

2 Have the load balancer set X-Forwarded-Proto to https and use a Valve to determine when to set HTTP/HTTPS. This works all the time, but requires a little more setup.

In your server.xml

<Valve className="org.apache.catalina.valves.RemoteIpValve" internalProxies="192\.168\.0\.10|192\.168\.0\.11" remoteIpHeader="x-forwarded-for" proxiesHeader="x-forwarded-by" protocolHeader="x-forwarded-proto" />

and in your load balancer configuration, set X-Forwarded-Proto to https

See https://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html for more information about how that works.

The example titled “Sample with internal proxies” is likely the one closest to the needs of most customers with load balancers.

  • No labels