Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

461
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!