I have setup one nginx rule
location ~ /(sitemap.*) {
alias /var/www/html/sitemaps/$1;
}
This works good for cases that I want like example
- https://example.com/sitemap-1.xml
- returns file /var/www/html/sitemaps/sitemap-1.xml
My issue is that that in response headers content type is content-type: text/plain
and not correct for xml file
Any way for nginx to automatically understand the content type and return proper header ?