reverse proxy http to tomcat

Solution 1:

Instead of plain http proxy, use proxy_ajp. Adapt the example below to match your needs, i.e. it is up to you to proxy everything to the container or only a namespace:

ProxyRequests off
ProxyPassMatch ^/(your_app)(.*) ajp://localhost:8009/$1$2 ttl=120 ping=1

Ensure that server.xml in your tomcat configuration includes an AJP listener. The executor is optional.

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
          maxThreads="150" minSpareThreads="4"/>

<Connector executor="tomcatThreadPool"
           port="8009" protocol="AJP/1.3"
           connectionTimeout="20000"
           URIEncoding="UTF-8"
           redirectPort="8443" />