如何使用正则expression式代理cookie(在nginx中)

我有一个服务器,可以接收/one_a/one_bpath中的请求。 我redirect/one_a?b?/some to /other 。 我也需要redirectcookiepath。

我尝试:

  location ~ /one_a?b?/some { rewrite ^/one_a?b?/some/(.*)$ /other/$1 break; proxy_pass http://127.0.0.1:3030; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_cookie_path /other $request_uri; } 

但是当请求是/one_a/some/login ,redirect的cookiepath变成/one_a/some/login

我需要结果是/one_a/some

注意: 我知道正则expression式也接受/one_/one_ab这对我来说可以。