Skip to content

fix: update nginx config to use docker service name for upstream#3699

Open
di3n0 wants to merge 1 commit intoverifywise-ai:developfrom
di3n0:fix/nginx-proxy-pass-to-backend
Open

fix: update nginx config to use docker service name for upstream#3699
di3n0 wants to merge 1 commit intoverifywise-ai:developfrom
di3n0:fix/nginx-proxy-pass-to-backend

Conversation

@di3n0
Copy link
Copy Markdown

@di3n0 di3n0 commented Apr 9, 2026

Problem

The frontend container was failing to connect to the backend (502 Bad Gateway) because 127.0.0.1 inside a container refers to the container itself, not the backend service.

Solution

Updated the Nginx proxy_pass to use the Docker Compose service name verifywise_backend_1 instead of localhost or 127.0.0.1. This allows Docker's internal DNS to correctly route the traffic.

Testing

Verified locally that the login request at http://localhost:8080/login no longer returns a 502 error and correctly communicates with the backend API.

Copy link
Copy Markdown
Collaborator

@MuhammadKhalilzadeh MuhammadKhalilzadeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @di3n0
Your code seems nothing wrong and looks good. Only that since it's on your repository, We're not able to run directly - but that's fine for such a small piece.
I'll also wait for my teammates @HarshP4585 and @Br0wnHammer to check (Download your code and test) as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants