merged changes between nginx 1.6.1 and 1.4.7
updated testcases