Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Where <contextPath> is replaced by the context path you've deployed your wicket application under.

The

Code Block

ProxyPass

directive causes request URLs to be proxied to the specified host.

The

Code Block

ProxyPassReverse

directive causes 302 redirects from your app server to be rewritten to point to the front-end proxy instead, so they continue to work properly.

The

Code Block
ProxyPassReverseCookiePath

directive (Apache For more recent versions of Apache ( 2.2+ only) you need to add the following:

Code Block

ProxyPassReverseCookiePath /<contextPath> /

rewrites cookie paths for you, so sessions work properly.

Why this doesn't always work

...

Code Block
<VirtualHost ordering.company.com>
  ProxyPass / http://appserver.company.com:8080/ordering/
  ProxyPassReverse / http://appserver.company.com:8080/ordering/
  # Apache 2.2+ only
  ProxyPassReverseCookiePath /ordering /
</VirtualHost>

<VirtualHost billing.company.com>
  ProxyPass / http://appserver.company.com:8080/billing/
  ProxyPassReverse / http://appserver.company.com:8080/billing/
  # Apache 2.2+ only
  ProxyPassReverseCookiePath /billing /
</VirtualHost>

The problem with this is that although requests get proxied across just fine, by default Wicket will construct absolute paths to links, resources, etc. using the context path that the wicket servlet is deployed under (e.g. /billing). For example, if your wicket servlet is mapped to accept requests to "/wicket", this means anchor href links might look like this: "/billing/wicket?foo".

...