Proxy settings do not work properly on the server (AWS) or in the yarn generated environment.
kodai305 opened this issue · comments
Kodai Takagi commented
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?
Tuvia commented