NGINX Redirection/Return with MultiSite

I have an NGINX server running WordPress MultiSite (sub-directories). Due to the way some sites were originally created, I need to create a redirect (or more correctly in NGINX terminology, a "return") on requests to a sub-domain (we'll call it sub.domain.com) to goto my.domain.com/sub (which is managed as a sub-site in my WP multi-site).

From what I've read, I have two basic choices - hard-code it in the nginx config or use some regular expressions to translate the redirect. Either way, I can't seem to get it it to work. NGINX responds to sub.domain.com but it always redirects to the main sub-site in the WP site. Any ideas? Here is a copy of the relevant NGINX config. We are running SSL for both the front and back end.

I'd appreciate any other feedback you see on the config below. If you think it would be helpful to see more configuration, let me know, but I think I have the parts that matter.

server {
server_name sub.domain.com;
return 301 https://my.domain.com/sub$request_uri; #would like this to be dynamic
}

map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
}

server {
listen 80;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
server_name my.domain.com sub.domain.com;

root /var/www/wwwroot_domain;
index index.php;