I found your rules here: https://rtcamp.com/wordpress-nginx/tutorials/plugins/yoast-seo-sitemap/ and they are slightly different from what I was using but I don't know enough to understand what's "better" or safer.
Care to let me know which set I should use, yours or mine?
mine:
location ~ ([^/]*)sitemap(.*)\.xml$ {
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
}