How to make nginx override web app route for sitemap and robots?

by user305883   Last Updated March 20, 2016 08:01 AM

I would like to make nginx serve sitemap and robots. My problem is that route is handled by flask, configured to handle request with certain patterns - would result in error 404.

I also posted this question in stackoverflow: [].

I thought it may be more relevant to webmasters because answers to similar questions in SO suggest to make flask serve static files, rather than make sitemaps be served directly from server (as commented here at last comment: []).

My sitemap is a site_map_index, and would like to organise all types of sitemaps__progressive_digit_number.xml files into a folder:


and make nginx serve sitemap as:

(and not, since sitemaps files include links global to the site).

How could I override the routing of my web app (here made in flask)?

In [] I attempted a configuration with location directive with no success.

Related Questions

Updated September 06, 2018 07:04 AM

Updated April 02, 2018 05:04 AM

Updated August 09, 2019 17:04 PM

Updated April 07, 2016 08:01 AM

Updated April 27, 2019 09:04 AM