Esta é sua resposta:
location ~ ^/supplier-shop/(?<id>(.*)) {
rewrite ^ http://$server_name/seller/$id permanent;
}
Funciona também para diretórios com n
level. Exemplo:
> GET /supplier-shop/asdasd/asdasd HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.10.3 (Ubuntu)
< Date: Thu, 28 Jun 2018 00:10:02 GMT
< Content-Type: text/html
< Content-Length: 194
< Connection: keep-alive
< Location: http://www.example.com/seller/asdasd/asdasd