Hello All,
I was trying to use nginx in a proxy_pass mode, and redirect requests to a set of servers based on the $request_body contents. I tried the following simplified sample configuration but it does not seem to work.
server {
# Some config settings...
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
if ($request_body ~* 'my_param=.+%23.+' )
{
proxy_pass http://server_group_b;
break;
}
proxy_pass http://server_group_a;
}
}
Could someone please explain why this would not work and a better way to do it ?
Thanks.
}
I was trying to use nginx in a proxy_pass mode, and redirect requests to a set of servers based on the $request_body contents. I tried the following simplified sample configuration but it does not seem to work.
server {
# Some config settings...
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
if ($request_body ~* 'my_param=.+%23.+' )
{
proxy_pass http://server_group_b;
break;
}
proxy_pass http://server_group_a;
}
}
Could someone please explain why this would not work and a better way to do it ?
Thanks.
}