I'm trying to display my sitemaps. Browsers display my sitemap index as xml but treat post sitemaps as plain text.
I tried to override content type with below configuration but it didn't help.
location ~ \.xml$ {
proxy_hide_header Content-Type;
add_header Content-Type "application/xml";
}
How do I force nginx to set content type as "application/xml" ?
Btw sitemaps in nutshell..
sitemap index
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://www.example.com/sitemaps/sitemap-1.xml</loc>
<lastmod>2019-02-10T12:22:18+00:00</lastmod>
</sitemap>
....
</sitemapindex>
and one of posts sitemaps
<loc>http://www.example.com/en</loc>
<xhtml:link rel="alternate" hreflang="en" href="http://example.com/en" />
<xhtml:link rel="alternate" hreflang="fr" href="http://example.com/fr" />
<lastmod>2019-02-10T00:00:00+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>
<url>
.....
I use default laravel nginx configuration