nuxt-community / axios-module

Secure and easy axios integration for Nuxt 2
https://axios.nuxtjs.org
MIT License
1.19k stars 245 forks source link

axios proxy for images occasionally failed! #443

Open mjzarrin opened 4 years ago

mjzarrin commented 4 years ago

I'm using axios-module with proxy to proxy images. here are my latest config.

nuxt.config.js

modules: [
    '@nuxtjs/axios'
]
axios: {
    proxy: true,
    retry: true,
    debug: true,
    proxyHeaders: true,
  },

proxy: {
    '/images': {
      target: 'https://destination.com/images',
      pathRewrite: {
        '^/images/': '/',
      },
    },
      changeOrigin: true,
      preserveHeaderKeyCase: true,
      cookieDomainRewrite: 'www.destination.com',
      cookiePathRewrite: '/',
    },
  },

And there is a page with infinite scroll to show images. the image section is like the following;

page.vue

<v-img :src="item.image"></v-img>

All is good, however, about 5% to 10% of requests (randomly and may change by refresh) fail and their images do not load. adding retry, proxyHeaders and allowing to write cookie flags to axios configuration doesn't help either.

sadly, I couldn't find any informative logs.

I shall be so happy to hear your comments.

farnabaz commented 3 years ago

Hi there, Sorry for the late response Could you provide a reproduction sample using template.nuxtjs.org