another update: using server_name localhost; or private ipaddress, it always redirect but using public hostname the nginx is functioning well. Anyway how to bypass this one? thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,216297,216302#msg-216302