Thx to the forum. I just googled the problem of "can't redirect to 302 by writing Nginx Module code", and linked to this forum. the Topic "how to redirect 302 in code?" solved my problem!
I am a Chinese student doing my internship in Chinese web set : taobao.com. Now, I'm in charge of a project like migrating the http server from Apache to Nginx!
wooow~ my first topic~~