server {
listen XXXXXX;
server_name www.abc.com;
if ($request_uri ~* "/haha.php\?qid=(.*)$")
{
set $growingId $1;
rewrite ^/* http://111.111.111.111/haha.php?qid=$growingId? last;
}
if ($request_uri ~* "/\?qid=(.*)$")
{
set $growingId $1;
rewrite ^/* http://111.111.111.111/?qid=$growingId? last;
}
if ($http_host = www.abc.com) {
rewrite (.*) http://www.cba.com$1;
}
}