hi Maxim , Your answer is right and thank you for it. I applied it with small correction. set $modified_uri $request_uri; if ($modified_uri ~ "^/gateway(/.*)") { set $modified_uri $1; } proxy_pass http://upstream$1; Thank you, Malintha Posted at Nginx Forum: http://forum.nginx.org/read.php?2,256639,256669#msg-256669