0

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?

Petr H
  • 452
  • 1
  • 3
  • 10

1 Answers1

1

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.

covener
  • 17,402
  • 2
  • 31
  • 45
  • I see, thank you. One quick related question: If I want to setup that reverse proxy as conditional (depending on the value of certain request header) I'll have to resort to RewriteRule (with RewriteCond) anyway, right? There's currently still no way how to do it without mod_rewrite I suppose. – Petr H Jul 19 '21 at 11:25
  • you could probably do it with in 9.0 but I would probably do it with mod_rewrite if it was conditional. – covener Jul 19 '21 at 12:01