Nginx proxy_pass problem

I need a “special” configuration for nginx.
I have a VHOST (ie.:test.pippo.net) with its document root.
For better google indicization I need to forward and masquerade (with
proxy_pass?) all http request for test.pippo.net/country_*/ to
$1.pippo.net

Is it possibile?

Thanks.

Alessandro De Filippo ha scritto:

I need a “special” configuration for nginx.
I have a VHOST (ie.:test.pippo.net) with its document root.
For better google indicization I need to forward and masquerade (with
proxy_pass?) all http request for test.pippo.net/country_*/ to
$1.pippo.net

Is it possibile?

Yes.

Not tested:

server {
server_name test.pippo.net;

location  /country_ {
   rewrite  ^(/country_.*/.*)$  $1.pippo.net/$2  permanent;
}

Thanks.

Manlio P.