My app with subdomain is a dockerized Laravel application and I want to "reference" it in a new dockerzied vite Vue 2 application, so I've doing the following in the vite.config.js:
I've tried the following:
server: {
proxy: {
'/api': {
target: 'http://foo.example.st',
changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, ''),
},
}
},
and the api request calling something like a websocket once app is loaded:
getTenantInfo() {
return api.get('http://foo.example.st/api/auth/...')
}
this function is called once the App page is loaded. I've tried to setup on my docker-compose.yml
a network config "bridge" but still not working:
docker-compose error log:
➜ Local: http://localhost:5173/
front_1 | ➜ Network: http://[ip_address]:5173/
front_1 | 7:35:01 PM [vite] http proxy error at /api/auth/...:
front_1 | Error: connect ECONNREFUSED 127.0.0.1:80
front_1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
I would appreciate for a help or advice