2

I am using Nuxt Robots for the dynamic creation of robots.txt file for different environments.

This is my robots config:

  robots: {
    UserAgent: '*',
    Allow: '/',
    Sitemap: `${process.env.SITE_URL}sitemap.xml`
  },

But, Sitemap is generated by Back End, and I need to refer to it.

Code: ${process.env.SITE_URL}sitemap.xml

Example of link to Sitemap file for staging environment: https://www.staging1.my-project/sitemap.xml

And I need to refer to it, and make this functionality work, because now when I am opening https://www.staging1.my-project/sitemap.xml in my browser, the browser thinks that this is the route of my application, and my app shows 404 page (because there are no such page)

How could I fix it, and see Sitemap generated by Back End, when I am opening .../sitemap.xml?

Dasha
  • 21
  • 2
  • It really depends on how your application is being served. Is www.staging1.my-project served by the Nuxt server app directly? Or is it behind a reverse proxy like NGINX or Apache? – RWD Jan 20 '22 at 09:35

0 Answers0