Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NGINX nginx: [emerg] host not found in upstream "server" in /etc/nginx/conf.d/default.conf:12 #285

Open
rojosinalma opened this issue Sep 11, 2024 · 3 comments · May be fixed by #564
Labels
chores Refactoring or small updates
Milestone

Comments

@rojosinalma
Copy link

rojosinalma commented Sep 11, 2024

Describe the bug
NGINX cannot find server upstream because the container name is not named like that.

** Logs **

nginx: [emerg] host not found in upstream "server" in /etc/nginx/conf.d/default.conf:12

To Reproduce
Steps to reproduce the behavior:

  1. Set the server container_name in the compose file to anything else other than server
  2. Start the compose file
  3. Proxy crashes

NOTES:

The NGINX config should not point to a hardcoded name of the server upstream, but instead depend on an env var or something like that.

I understand that everyone can set up their own proxy and overall most people will do it that way, but you can't just depend on people calling the ssm server plain server either. It's too much of a generic name.

@rojosinalma
Copy link
Author

Same thing happens when renaming the client container

@rojosinalma
Copy link
Author

rojosinalma commented Sep 11, 2024

Problem also exists when the client tries to connect to the Mongo instance if the mongo container is not called "mongo".

Hardcoding URLs or external connections is a horrible idea.

@SquirrelDeveloper
Copy link
Collaborator

Hi @rojosinalma . Thanks for the feedback, giving user flexibility through ENV vars is well in my mind, and planned in the near future. Feel free If you can to open a PR to speedup the process :-)
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chores Refactoring or small updates
Projects
2 participants