Closed jamie0xgitc0decat closed 3 months ago
Hey @jamie0xgitc0decat 👋
I believe the issue stems from the fact that you're trying to fetch localhost
on your server and your server doesn't understand how to resolve that address. You should also see this error if you use fetch
directly without Apollo Client.
I found this issue which might give some hints on how to fetch from localhost on your server. Beyond this though, I'm afraid I won't be able to give much guidance since nginx/docker network configuration is not my area of expertise and is outside the scope of Apollo Client itself. As such, I'm going to close this issue. Please let me know if I've misunderstood the ask here and I'd be happy to reopen if necessary.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
I forgot to mention, feel free to join our discord channel which is a more appropriate place for this kind of question. Other community members there might be able to provide some guidance on what to do.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.
I am encountering a persistent ECONNREFUSED error with Apollo Client in my Next.js application. Despite trying various configurations and troubleshooting steps, including Nginx settings and Docker network settings, the issue persists. Below are the details of my setup and the steps I have taken.
Description I have been facing this issue for around two weeks. I have tried everything I know so far, but I still have no clues about what is going on. I am posting this issue here to seek help from the community.
My problem is that I am deploying my backend application to an AWS Ubuntu instance and using Nginx to route to different Docker containers, including frontend and backend.
I have tested these setups in my local environment without any problems. Even making local frontend network calls to the AWS backend container works fine. However, the AWS frontend container connecting with the backend container does not work as expected, causing any web page to show an "Internal Server Error".
Technical Details
Nginx Configuration:
Docker Network Config
Apollo Client File
_app.tsx
pages/index.tsx
Backend Server Cors Config
Execution order on Frontend docker logs
that means when I nagivate to domain.com -> domain.com/en-US -> make the execution order on above
You can see the ECONNREFUSED error inside the new ApolloClient initialization.
The execution reaches the end of apollo-client.ts and then returns back to _app.tsx.
What I Have Checked So Far