Server Bundle Reverse Proxy Support
These instructions describe how to configure the server bundle to operate behind a reverse proxy.
ProxyName and ProxyPort
In
$OSAFSRV_HOME/tomcat/conf/server.xml, you can set the
proxyName and
proxyPort attributes on a
Connector element. This will cause Tomcat to communicate these values for the server name and server port to web applications rather than the real server name and server port.
SSL
If your reverse proxy is negotiating SSL and passing plaintext HTTP requests back to Tomcat, then you'll need to add the
scheme attribute to the
Connector as well, so that Tomcat knows to generate URLs with the
https scheme rather than
http. In this configuration, the
secure attribute must be set to
false.
URL Space
If you need to assign a specific namespace for Cosmo in the reverse proxy, then you'll need to match up the proxy path with the Tomcat context path for that webapp. This is the
path attribute of the appropriate
Context element in
server.xml. By default, this is
/chandler for Cosmo. The server bundle contains two additional webapps: the
ROOT webapp, with the server bundle's welcome page and context path ""; and the Cosmo documentation webapp, with context path "/chandler-docs".
Putting It All Together
<Connector port="8080" enableLookups="false"
proxyName="example.org"
proxyPort="80"
secure="false" scheme="https"/>
and
<Context path="/internal/chandler" docBase="cosmo-0.10.0" reloadable="false">
will cause Tomcat to generate URLs of the form
https://example.org/internal/chandler/pim/
instead of
http://example.org:8080/chandler/pim/
References
See the following url for details on Tomcat 5.5's proxy support:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html#Proxy%20Support