こういう構成のdocker-composeで、frontendコンテナ(Nuxt.js:localhost:3000)から backendコンテナ(Laravel:localhost:8000)にAPIリクエストをしたら [HPM] Error occurred while trying to proxy request /api/hoge from localhost:3000 to http://localhost:8000/ という504エラーが返ってきて、backendまで届いていない。。 これは フロントエンドの nuxt.config.js のproxy設定が間違っていて、 proxy: { '/api': { target: 'http://localhost:8000/api', pathRewrite: { '^/api/': '/' } } }, を以下のように修正して
![docker-composeのNuxt.jsからAPIをコールしたら「[HPM] Error occurred while trying to proxy request」 - メンチカツ](https://cdn-ak-scissors.b.st-hatena.com/image/square/2a671ac5d439444bbf700e018735b0d57faa2779/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fe%2Feasy-breezy%2F20191025%2F20191025170443.png)