I have a site on my local ubuntu dev box with some mod rewrite rules, which we are attempting to use to force google and other bots to index the correct page, rather than our ajax snippets as they have been doing. Although the rules are a bit longer that the snippet below, by disabling everything a section at a time, I find that even the most basic rewrite fails on the production server, but works fine on dev, even handling load testing with 14k requests via cUrl, no problem. We are using rewrite because proxypass doesn't work inside an <if>
, and can't work based on %{QUERY_STRING}
.
ProxyPass we were using before:
ProxyPreserveHost on
ProxyPass ajp://127.0.0.1:8009/other/view retry=0
ProxyPassReverse ajp://127.0.0.1:8009/request/view
The simple rewrite that causes 0.3 second mod_proxy request on dev to take upwards of 30 seconds on production:
RewriteRule ^(.*)(/request/view) ajp://localhost:8009/other/view [P]
Both servers are ubuntu and use the same version of apache:
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2022-06-14T12:30:21
Both use LogLevel warn
I have used diff to verify that both files contain identical rewrite rules. I have checked that they both load the same mods (the dev box does load one mod that is not on prod, fcgid, but we are not using cgi anyways). The only thing of note we can think of, is that dev is http, and prod is https. This problem is immediate on loading the above rewrite condition and rule, and evaporates reverting to the ProxyPass
directive - it is not tomcat9 based.
I need help on the next steps in troubleshooting, thanks.