The solution was simple. We just need to pass the "sitemap name" as a URI to "index.php" which can be done by simply adding this to "server block":
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last; rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;If you are already using Nginx with Wordpress friendly URLs, these steps are not necessary and redundant.