In the process of trying to understand this issue, I realized that what I actually needed was to redirect instead of trying to proxy. In addition to many things that I eventually changed, I checked the $args
variable instead of $request_body
. Here is what the rewrite blocks looked like when I was finished
if ($args ~ fuseaction\=public\.race_search(_all(_by_type)?)?)
{
rewrite ^(.*)$ /search/events? permanent;
}
if ($args ~ fuseaction\=public\.tools)
{
rewrite ^(.*)$ /directors? permanent;
}
if ($args ~ fuseaction\=public\.contact)
{
rewrite ^(.*)$ /contact? permanent;
}
if ($args ~ fuseaction\=public\.spotlight)
{
rewrite ^(.*)$ /search/events? permanent;
}
if ($args ~ fuseaction\=public\.results)
{
rewrite ^(.*)$ /search/results? permanent;
}
The first argument matches the entire path, the second tells it what to rewrite to, with the trailing ?
to remove any query parameters from the rewrite, and the third to do a 301 (permanent) redirect.