Fritsch, Andre wrote:
Hello Björn,

That sounds good. But how do I realise it?

i solved this problem with tomcat simply by setting a couple of attributes on the http connector in server.xml. dunno if you're using tomcat within jboss, or even if jboss uses tomcat anymore (it's been a few years since i worked with bjoss), but this might lead you in the right direction or help somebody else with a problem more similar to mine.

in detail, here's what i did to get my tomcat 5.5 webapp working behind a reverse proxy (snipped from <https://bugzilla.osafoundation.org/show_bug.cgi?id=3862#c6>):

in server.xml, you can set the "proxyName" and "proxyPort" attributes on a Connector. this will cause tomcat to use these values rather than the server name and port that tomcat understands.

if your reverse proxy is negotiating ssl and passing plaintext http requests back to tomcat, then you'll need to add the "secure" and "scheme" attributes to the connector as well, so that tomcat knows to generate urls with the https scheme rather than http, and so that other container and webapp code knows that the request is considered to be secure.

if you need to assign a specific namespace to cosmo in the reverse proxy, then you'll need to change the default context path for the cosmo webapp - this is the "path" attribute of the Context element. it's "" by default, signifying the root namespace.

putting it all together:

    <Connector port="8080" enableLookups="false"
               proxyName="cosmo-demo.osafoundation.org"
               proxyPort="80"
               secure="true" scheme="https"/>

and

        <Context path="/internal" docBase="cosmo" reloadable="false">

will cause tomcat to generate

  https://cosmo-demo.osafoundation.org/internal/account

instead of

  http://hostname:8442/account

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>

fwiw, i also considered using a response wrapper, but i prefer to solve these sorts of problem in configuration when possible :)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to