title: Handling X-FORWARDED-PROTO header in Java web application
body: <p>Can any one guide me in working with <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto" rel="nofollow noreferrer">X-FORWARDED-PROTO</a> header in Java web application deployed to Apache Tomcat.</p>
  
  <p>The application setup is in such a way that tomcat talks with Apache webserver, which in turn talks with Cisco Load Balancer, finally the balancer publishes the pages to the client (tomcat -> apache2 -> load balancer -> client).</p>
  
  <p>The SSL Certificate is installed in Load Balancer and it's handling HTTPS requests. My requirement is to make the application behave in such a way that it uses the <em>X-FORWARDED-PROTO</em> and change the pages as HTTP or HTTPS.</p>
  
  <p>Checking on the header files of my webpages I could not find the <em>X-FORWARDED-PROTO</em> header. I don't have access to the Load Balancer configuration either, and the IT has suggested us to use the <em>X-FORWARDED-PROTO</em> to differentiate between HTTP and HTTPS request.</p>
  
  <p>Is there any configuration to be done in Tomcat or Apache level so that it will return the <em>X-FORWARDED-PROTO</em> header? Or is it that the configuration should be handled in Load Balancer?</p>