We're using Apache as reverse proxy (mod_proxy). The most crucial feature for all of us is url mapping (simple url spinning) including spinning of cookie pathways. When I remarkably learned nginx doesn't rewrite cookie pathways (with factory modules). I don't know however i believe HAProxy can perform this. Apache is simply too heavy just for this task. You can as well discuss things to use in cases like this? (after sales is really a Java application server e.g. Tomcat)

  1. Keep using Apache
  2. Use nginx with a few third party modules (lua etc.)
  3. Use HAProxy

I'd investigate HAProxy, unless of course you're attempting to cache that content too (server offload). It's pretty impressive cookie support.

In my opinion, I've discovered HAProxy very lightweight and simple to utilize. You are able to define URL/cookie rewrites using the reqrep/reqirep keyword, which may be put on anything within an HTTP header request. For instance:

# add cookie 'backend=2' for any HTTP method followed by
#  '/img' only or '/img/' followed by anything:

reqirep ^[^:\ ]*\ /img[/\ ].* \0\nCookie:\ backend=2

Same idea for URL rewrites:

# replace "/static/" with "/" at the beginning of any request path:

reqrep ^([^\ ]*)\ /static/(.*)     \1\ /\2