websphereibmhttpserver

IHS & WAS Plugin: Recommended approach to bypass the plugin & reverse proxy to another backend


I need to configure a reverse proxy for certain URLs that overlap with what the WAS plugin handles. These particular requests should be forwarded to some other system.

Now there are at least 2 options:

  1. RewriteRule ... [P,L] - which makes use of the fact that mod_rewrite takes precedence over the WAS plugin
  2. SetEnvIf Request_URI ... skipwas=1 + ProxyPass ... - which explicitly tells the WAS plugin to ignore certain URLs, but it requires at least 2 directives (so the configuration is more complex)

AFAIK it's generally recommended to avoid the use of mod_rewrite unless really needed as it's an overkill in many cases and perhaps provides slightly worse performance.

With that in mind, what would be the recommended approach for the above case?


Solution

  • I prefer #2 because it is more explicit. It is very easy for a colleague to miss a single 'P' in a RewriteRule. It also suffers from mod_rewrites unusual default of not merging config to virtual hosts.

    Finally, If you use #1 you also need to define a mod_proxy "worker" by writing the ProxyPass or using a <Proxy> block otherwise you will not get connection re-use.