nuxt-community / proxy-module

The one-liner node.js http-proxy middleware solution for Nuxt 2 using http-proxy-middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proxy settings do not work properly on the server (AWS) or in the yarn generated environment.

kodai305 opened this issue · comments

I have the following settings in nuxt.config.ts.

  axios: {
    proxy: true
  },

  proxy: {
    '/api/': {
      target: 'https://hoge.co.jp/v1/',
      changeOrigin: true
    },
  }

Call the API in the following way.

await axios.get(
'/api/xxx
)

With such a configuration, I did yarn dev and it works fine on localhost.

However, when I deploy the yarn generate on AWS, it does not work properly.

Also, it doesn't work properly on local PC with yarn generate + yarn start.

Is there a problem with the configuration?

commented

I believe this ticket should be closed! yarn generate does not work here as the README states ...

grafik