Nginx 重写规则不适用于子域

Nginx Rewrite rule not working with subdomain

我想像这样重定向 URL:

  http://example.com/tmcontent/comprehension/el_semenario.mp3

对此:

  http://static.example.com/tmcontent/comprehension/el_semenario.mp3

目前我正在做这个

  rewrite /(tmcontent.*)$  http://static.example.com/ redirect;

但遗憾的是不起作用。

location /tmcontent {
    return 301 http://static.example.com/$request_uri;
}