Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

463
Vistas
404 Not found for sitemap.xml on nuxt.js

I am using nuxt.js sitemap-module to generate sitemap.xml It working perfectly with npm run build && npm run start on local.

However, it won't work when it's on the cloud with Nginx. https://vtapau.com/sitemap.xml

Here is my Nginx config

server {
        listen 80;
        server_name vtapau.com www.vtapau.com;

        location / {
                proxy_pass http://localhost:8081/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_redirect off;
        }
}
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

First of all, I really has no idea if this is valid answer to you as you mentioned you've put manually created sitemap into static folder.

I think you misconfigured the sitemap, for sitemap.xml to work, you set routes inside sitemap object:

// nuxt.config.js

{
  sitemap: {
    hostname: 'https://example.com',
    gzip: true,
    exclude: [
      '/secret',
      '/admin/**'
    ],
    routes: [
      '/page/1',
      '/page/2',
      {
        url: '/page/3',
        changefreq: 'daily',
        priority: 1,
        lastmod: '2017-06-30T13:30:00.000Z'
      }
    ]
  }
}

When I was asked to select language, I suspected that your sitemap has split into different languages. I managed to get English version sitemap here.

If your sitemap configuration is like below:

// nuxt.config.js

{
   sitemap: {
     hostname: 'https://example.com',
     lastmod: '2017-06-30',
     sitemaps: [
       {
          path: '/sitemap-foo.xml',
          routes: ['foo/1', 'foo/2'],
          gzip: true
       }, {
          path: '/folder/sitemap-bar.xml',
          routes: ['bar/1', 'bar/2'],
          exclude: ['/**']
       }
     ]
   }
}

You should able to get your sitemap at https://vtapau.com/sitemapindex.xml. I hope this is not the static xml you've created otherwise nothing I could help already. This documentation was clearly mentioned at sitemap-module, when things configured wrongly always go back to the github documentation or find answer through github issues there.

  • Also great to see Malaysia new startup in food delivering.
over 4 years ago · Santiago Trujillo Denunciar

0

I faced exactly the same problem. I then discovered that on the production server, the Nuxt server was started using nuxt start instead of what nuxt-ts start was using locally. Which was the problem in my case. I hope this helps.

over 4 years ago · Santiago Trujillo Denunciar

0

Restart your PM2 server after you run npm run build. Otherwise, the /sitemap.xml will not appear.

This has been the case for me.

My config for sitemap module:

sitemap: {
   hostname: 'https://example.com',
   gzip: true,
   exclude: ['/exampleurl']
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda