0

I run a Tomcat 7 server in the local branch of our company. The server was available to public via port 80 and 443. Some days ago the configuration got changed by the HQs admins; Tomcat now needs to be connected by reverse proxy. The HQ admins changed the firewall rules, changed the DNS entry, and configured the reverse proxy. Since they have no experience with tomcat they asked me to change the configuration in order to have Tomcat to listen on 8080 for requests from the reverse proxy.

Tomcat's Connectors are defined as follows:

<Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="443" />
    <Connector
           protocol="HTTP/1.1"
           port="443" maxThreads="400"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="foobar.jks" keystorePass="foo_bar"
           clientAuth="false" sslProtocol="TLS"/>
 <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000" proxyName="server.company.com" proxyPort="443" />

However, when I call the URI from firefox, I get a "redirect error" stating that there is a redirect that can't be finished. In Tomcats access log there are entries of the following schema:

<revere proxy internal ip> - - [14/Dec/2015:15:52:31 +0100] "GET / HTTP/1.1" 302 -

If I remove the proxyName and proxyPort connector properties, a redirect to the internal server name of tomcat is sent.

Any help solving this issue is appreciated.

  • @Jukka , this did the trick, big thx! If you're keen on reputation, please post it as an answer so that I can check it as correct answer. – Mr.Radar Dec 17 '15 at 15:42
  • Moved comment into an answer – Jukka Dec 18 '15 at 11:30
1

Try adding scheme="https" and secure="true" to the connector with port 8080, assuming the reverse proxy is doing SSL offloading.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.