0👍
✅
Finally figured it out.
I removed the plugin and instead I added onProxyReq
method in the nuxt.config.js
proxy: {
'/api/': {
target: 'api.example.com',
headers: {
'origin': 'www.example.com',
// ...
},
pathRewrite: {
'^/api/': ''
},
onProxyReq: (proxyReq, req, res) => {
proxyReq.setHeader('origin', 'www.example.com')
}
},
}
// ...
Source:stackexchange.com