Configure tomcat behind loadbalancer to respond on HTTP and HTTPS
Posted
by
user253530
on Server Fault
See other posts from Server Fault
or by user253530
Published on 2012-08-30T08:25:01Z
Indexed on
2012/08/30
9:40 UTC
Read the original article
Hit count: 323
I have 2 tomcat machines behind a load balancer on Amazon EC2. Until now The load balancer was configured to respond only on https. So in order to access our services you would go to https://url
. Tomcat was configured to listen on 8080 but the connector had additional params that would tell tomcat that it is behind a proxy and that it should respond on HTTPS 443.
The connector looks like this:
<Connector scheme="https" secure="true" proxyPort="443" proxyHost="my.domain.name"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="UTF-8" />
What i would like to do is to open port 80 on the load balancer and basically allow traffic on HTTP and HTTPS. I've configured the load balancer to redirect all HTTP traffic to the tomcat machines on port 8088. I was thinking that i could define a new connector so that all HTTPS traffic goes to 8080 and HTTP to 8088. Unfortunately i did not succeed. Here is my connector
<Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"
useBodyEncodingForURI="true" URIEncoding="UTF-8" />
Am I missing something?
Thanks
© Server Fault or respective owner