robots icon indicating copy to clipboard operation
robots copied to clipboard

robots.txt 404 error

Open aswinghosh-2hats opened this issue 2 years ago • 3 comments

I can access robots.txt in local environment but gives 404 error in server (vercel)

"devDependencies": { ------------------- "@nuxtjs/robots": "^2.5.0", "nuxt": "^2.15.8", }

aswinghosh-2hats avatar Aug 12 '22 16:08 aswinghosh-2hats

Same issue for me.

Works when running npm run dev and npm run build | npm run start locally, but neither work on the server. Also tested in development/production mode and, again, both work locally.

Server is nginx "@nuxtjs/robots": "^2.5.0", "nuxt": "2.15.8",

domabbott92 avatar Aug 15 '22 13:08 domabbott92

Just to clarify, you are not using Nuxt bridge?

dargmuesli avatar Sep 14 '22 02:09 dargmuesli

If he was using nuxt bridge, he would be using nuxt-edge and not nuxt library. He is using nuxt 2 without the bridge. image

ThomasBerneSV avatar Oct 06 '22 06:10 ThomasBerneSV

Hi @aswinghosh-2hats

Its works https://nuxt-robots-example.vercel.app/robots.txt https://github.com/ricardogobbosouza/nuxt-robots-example

You configured vercel.json ? https://github.com/ricardogobbosouza/nuxt-robots-example/blob/main/vercel.json

Does the problem still persist?

ricardogobbosouza avatar Oct 28 '22 15:10 ricardogobbosouza