Mobile app version of vmapp.org
Login or Join
Cooney921

: How to make nginx override web app route for sitemap and robots? I would like to make nginx serve sitemap and robots. My problem is that route http://example.com/ is handled by flask, configured

@Cooney921

Posted in: #GoogleIndex #Nginx #RobotsTxt #Sitemap #WebApplications

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

I also posted this question in stackoverflow:
[https://stackoverflow.com/questions/36024790/serving-sitemap-from-nginx-when-flask-routing-at-root].

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:
[https://stackoverflow.com/a/4241389/305883]).

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

/var/www/example.com/sitemaps/*.xml


and make nginx serve sitemap as:
example.com/sitemap.xml

(and not example.com/sitemap/sitemap.xml, since sitemaps files include links global to the site).

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

In [https://stackoverflow.com/questions/36024790/serving-sitemap-from-nginx-when-flask-routing-at-root] I attempted a configuration with location directive with no success.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme